<?php

namespace App\Models\cms\Ticket;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Auth;

class Ticket extends Model
{
    use HasFactory;
    protected $table = 'tickets';

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

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