first commit
This commit is contained in:
commit
0baac018a2
1011 changed files with 145854 additions and 0 deletions
77
app/Models/SySetting.php
Normal file
77
app/Models/SySetting.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class SySetting
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string $message
|
||||
* @property string $action
|
||||
* @property int $status
|
||||
* @property bool $active
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting findSimilarSlugs($attribute, $config, $slug)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereAction($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereSlug($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class SySetting extends Model
|
||||
{
|
||||
use Sluggable;
|
||||
|
||||
protected $table = 'sy_settings';
|
||||
|
||||
protected $casts = [
|
||||
'status' => 'int',
|
||||
'active' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'message',
|
||||
'action',
|
||||
'status',
|
||||
'active'
|
||||
];
|
||||
|
||||
public static $statusTypes = [
|
||||
1 => 'default',
|
||||
];
|
||||
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function getStatusType(){
|
||||
return isset(self::$statusTypes[$this->status]) ? self::$statusTypes[$this->status] : "";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue