You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried to create a new model with App\Models\Tennis\Court
What I expected to happen
I expected 1 model Court.php to be created in the directory app/models/tennis.
What happened
It created 2 models:
app/models/Court.php:
<?php
namespace App\Models;
use Backpack\CRUD\app\Models\Traits\CrudTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Court extends Model
{
use CrudTrait;
use HasFactory;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'courts';
// protected $primaryKey = 'id';
// public $timestamps = false;
protected $guarded = ['id'];
// protected $fillable = [];
// protected $hidden = [];
// protected $dates = [];
}
and
app/models/tennis/Court.php:
<?php
namespace App\Models\Tennis;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Court extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'CourtId',
'CourtName',
'CityName',
'place_id',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
];
public function place()
{
return $this->belongsTo(\App\Models\Place::class, 'place_id');
}
}
Also, the CourtCrudController.php did not use the subdirectory structure which I would assume would make a lot of sense. Same for Requests.
I
The text was updated successfully, but these errors were encountered:
Just recognized that the generated CRUD Controller does not contain any fields from the model inside
setupCreateOperation() and setupListOperation() functions.
Bug report
What I did
Tried to create a new model with App\Models\Tennis\Court
What I expected to happen
I expected 1 model Court.php to be created in the directory app/models/tennis.
What happened
It created 2 models:
app/models/Court.php:
and
app/models/tennis/Court.php:
Also, the CourtCrudController.php did not use the subdirectory structure which I would assume would make a lot of sense. Same for Requests.
I
The text was updated successfully, but these errors were encountered: