public_id}/edit"; } /** * @return mixed */ public function client() { return $this->belongsTo('App\Models\Client')->withTrashed(); } /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function tasks() { return $this->hasMany('App\Models\Task'); } } Project::creating(function ($project) { $project->setNullValues(); }); Project::updating(function ($project) { $project->setNullValues(); });