'datetime', ]; protected static function boot() { parent::boot(); static::created(function ($user) { $user->profile()->create([ 'title' => $user->username, ]); }); } public function posts() { return $this->hasMany(Post::class)->orderBy('created_at', 'DESC'); } public function following() { return $this->belongsToMany(Profile::class); } public function profile() { return $this->hasOne(Profile::class); } }