Hi, I created two models with one-to-many relationship. I tried to disable the create button in detail page as the following code but it does not work. Did i do something wrong?
Steps To Reproduce:
# in model
class MyModel extends Model
{
protected $table = 'my_model';
public function his()
{
return $this->hasMany('App\Models\MyModelHis', 'name', 'name');
}
}
# in controller
protected function detail($id)
{
$show = new Show(MyModel::findOrFail($id));
$show->panel()
->tools(function ($tools) {
$tools->disableEdit();
$tools->disableDelete();
});;
$show->field('id', __('ID'));
$show->field('name', __('name'));
$show->his(function ($his) {
// --- not work
$his->panel()->tools(function ($tools) {
$tools->disableCreate();
});
// ---
$his->id("ID");
$his->tran_date('tran_date');
});
return $show;
}
Description:
Hi, I created two models with one-to-many relationship. I tried to disable the create button in detail page as the following code but it does not work. Did i do something wrong?
Steps To Reproduce: