Skip to content

Instantly share code, notes, and snippets.

@bvipul
Created January 26, 2018 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvipul/1f015c5d2a7cea5b9be5984abcfc6ca1 to your computer and use it in GitHub Desktop.
Save bvipul/1f015c5d2a7cea5b9be5984abcfc6ca1 to your computer and use it in GitHub Desktop.
Blog Model File
<?php
namespace App\Models\Blogs;
use App\Models\BaseModel;
use App\Models\Blogs\Traits\Attribute\BlogAttribute;
use App\Models\Blogs\Traits\Relationship\BlogRelationship;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
class Blog extends BaseModel
{
use ModelTrait,
SoftDeletes,
BlogAttribute,
BlogRelationship {
// BlogAttribute::getEditButtonAttribute insteadof ModelTrait;
}
protected $fillable = [
'name',
'slug',
'publish_datetime',
'content',
'meta_title',
'cannonical_link',
'meta_keywords',
'meta_description',
'status',
'featured_image',
'created_by',
];
protected $dates = [
'publish_datetime',
'created_at',
'updated_at',
];
/**
* The database table used by the model.
*
* @var string
*/
protected $table;
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->table = config('module.blogs.table');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment