<?php
namespace AppModels;
use IlluminateDatabaseEloquentBuilder;
use IlluminateDatabaseEloquentModel;
class Stat extends Model
{
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'date' => 'datetime:Y-m-d'
];
/**
* @param Builder $query
* @param $value
* @return Builder
*/
public function scopeSearchValue(Builder $query, $value)
{
return $query->where('value', 'like', '%' . $value . '%');
}
}