Current File : /home/tradevaly/public_html/app/Models/Tradeshows.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Tradeshows extends Model
{
    use HasFactory;
    
     protected static function boot() {
        parent::boot();

        static::creating(function ($question) {
            $question->slug = Str::slug($question->show_name);
        });
    }
    
}