<?php

namespace App\Models\cms\Feedback;

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

class Feedback extends Model
{
    use HasFactory;
    protected $table = 'feedbacks';

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

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