updated to laravel 11

This commit is contained in:
2024-04-22 18:16:33 +10:00
parent 5fbca80a3c
commit 5b7da699bd
503 changed files with 9672 additions and 73262 deletions

26
app/Models/Post.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use App\Helpers;
use App\Traits\HasFiles;
use App\Traits\Slug;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasFactory, Slug, HasFiles;
protected $fillable = ['title', 'content', 'user_id', 'status', 'published_at', 'hero_media_name'];
public function author()
{
return $this->belongsTo(User::class, 'user_id');
}
public function hero()
{
return $this->belongsTo(Media::class, 'hero_media_name');
}
}