<?php

namespace App\Models\cms\Masters;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class VehicleType extends Model
{

    //protected $table = 'master_vehicle_type';
    protected $fillable = [
        'name',
        'status',
    ];

    protected static function boot()
    {
        parent::boot();

        VehicleType::creating(function($model) {
            $user = Auth::user();
            if($user!=null)
              $model->entryby = $user->id;
            //$model->companyid = 1;
        });
    }
}
