firstcommit

This commit is contained in:
2025-08-17 16:23:14 +05:45
commit 76bf4c0a18
2648 changed files with 362795 additions and 0 deletions

View File

View File

@@ -0,0 +1,51 @@
<?php
namespace Modules\Post\app\Models;
use Modules\Page\app\Models\Page;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
const FILE_PATH = 'uploads/posts/';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'slug',
'image',
'title',
'short_detail',
'full_detail',
'page_id',
'sidebar_flag',
'navbar_flag',
'order',
'meta_title',
'meta_description',
'meta_keywords'
];
/**
* Relation with page
*/
public function page()
{
return $this->belongsTo(Page::class, 'page_id');
}
/**
* Function to get full image path
*/
public function getFullImageAttribute()
{
$result = null;
if($this->image) {
$result = asset('storage/' . Self::FILE_PATH . $this->image);
}
return $result;
}
}