%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/app/Models/
Upload File :
Create Path :
Current File : /var/www/html/news/app/Models/Role.php

<?php

namespace App\Models;

use App\Presenters\RolePresenter;
use Carbon\Carbon;
use HttpOz\Roles\Models\Role as BaseRole;
use HttpOz\Roles\Traits\HasRole;
use Illuminate\Notifications\Notifiable;
use Laracodes\Presenter\Traits\Presentable;
use Watson\Rememberable\Rememberable;

class Role extends BaseRole
{
    use Notifiable, Rememberable, HasRole, Presentable;

    const ROLE_SLUG_ADMIN = 'admin';
    const ROLE_SLUG_BACKOFFICE = 'backoffice';
    const ROLE_SLUG_EDITOR = 'editor';
    const ROLE_SLUG_VISITOR = 'visitor';

    protected $presenter = RolePresenter::class;

    protected $fillable = [
        'slug',
        'description'
    ];

    protected $casts = [
        'id'          => 'integer',
        'slug'        => 'string',
        'description' => 'string'
    ];

    protected $dates = [

    ];

    /**
     * @param $value
     * @return string
     */
    public function getCreatedAtAttribute($value)
    {
        return Carbon::parse($value)->toIso8601String();
    }

    /**
     * @param $value
     * @return string
     */
    public function getUpdatedAtAttribute($value)
    {
        return Carbon::parse($value)->toIso8601String();
    }

    public function setPasswordAttribute($value)
    {
        $this->attributes['password'] = bcrypt($value);
    }

}

Zerion Mini Shell 1.0