for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Theme extends Model
{
use SoftDeletes;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'themes';
* The attributes that are not mass assignable.
* @var array
protected $guarded = [
'id',
];
* Fillable fields for a Profile.
protected $fillable = [
'name',
'link',
'notes',
'status',
'taggable_id',
'taggable_type',
* Typecasting is awesome.
protected $casts = [
'id' => 'integer',
'name' => 'string',
'link' => 'string',
'notes' => 'string',
'status' => 'boolean',
'taggable_id' => 'integer',
'taggable_type' => 'string',
* The attributes that should be mutated to dates.
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
* Scope a query to get enabled themes.
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
public function scopeEnabledThemes($query)
return $query->where('status', 1);
}