$table->unsignedBigInteger('creater_id')->nullable();
$table->string('creater_type')->nullable();
$table->unsignedBigInteger('updater_id')->nullable();
$table->string('updater_type')->nullable();
$table->unsignedBigInteger('deleter_id')->nullable();
$table->string('deleter_type')->nullable();
public function creater()
{
return $this->morphTo();
}
public function updater()
{
return $this->morphTo();
}
public function deleter()
{
return $this->morphTo();
}
function dm(){
return auth()->guard('dm')->user();
}
public function index(): View
{
$data['lams'] = LocalAreaManager::with('creater')->whereMorph('creater_type', get_class(dm()), 'creater_id')->latest()->get();
return view('district_manager.lam_management.index', $data);
}
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'morph' in 'where clause'
Give me an error :
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'morph' in 'where clause'