migrate to gtea from bistbucket

This commit is contained in:
2026-03-15 17:08:23 +07:00
commit 129ca2260c
3716 changed files with 566316 additions and 0 deletions

34
app/Models/Blog.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Blog extends Model
{
use HasFactory;
protected $fillable = ['user_id', 'title', 'slug', 'image', 'status', 'descriptions', 'tags', 'meta'];
protected $casts = [
'user_id' => 'integer',
'tags' => 'json',
'meta' => 'json',
'status' => 'integer'
];
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
protected static function boot()
{
parent::boot();
static::creating(function ($blog) {
$blog->slug = Str::slug($blog->title);
});
}
}