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 BlogSetting extends Model
{
use SoftDeletes;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'blog_settings';
* The attributes that are not mass assignable.
* @var array
protected $guarded = [
'id',
];
* Fillable fields for a Profile.
protected $fillable = [
'name',
'key',
'value',
'active',
* Typecasting is awesome.
protected $casts = [
'name' => 'string',
'key' => 'string',
'value' => 'string',
'active' => 'boolean',
* The attributes that should be mutated to dates.
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
* Scope a query to get the themeId from the settings table.
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
public function scopeThemeId($query)
return $query->where('key', 'blog_theme_id');
}