<?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); }); } }