blog api created

This commit is contained in:
parsa aghaei committed 2024-10-13 20:16:08 +03:30
1 parent 4f101885a8
commit d98bc7bbb0
27 files changed
+1022 -44

No files matched your search

+7
View File
@@ -3,6 +3,8 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Models\Blog\Post;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@@ -44,4 +46,9 @@ class User extends Authenticatable
'password' => 'hashed',
];
}
public function posts()
{
return $this->hasMany(Post::class, 'author_id');
}
}