for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Xetaravel\Models;
use Eloquence\Behaviours\HasSlugs;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Xetaravel\Models\Presenters\CategoryPresenter;
class BlogCategory extends Model
{
use CategoryPresenter;
Xetaravel\Models\Presenters\CategoryPresenter
$slug
Xetaravel\Models\BlogCategory
use HasSlugs;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title',
'slug',
'description'
];
* The accessors to append to the model's array form.
protected $appends = [
'category_url'
* Return the field to slug.
* @return string
public function slugStrategy(): string
return 'title';
}
* Get the articles for the category.
* @return HasMany
public function articles(): HasMany
return $this->hasMany(BlogArticle::class);