src/Models/Business.php
public static function boot()
    {
        parent::boot();

        static::creating(function ($business) {

            $business->slug = $business->makeSlug($business->name);

        });
    }
public static function boot()
    {
        parent::boot();

        static::creating(function ($business) {

            $business->slug = $business->makeSlug($business->name);

        });
    }
public static function boot ( ) { parent :: boot ( ) ; static :: creating ( function ( $ business ) { $ business -> slug = $ business -> makeSlug ( $ business -> name ) ; } ) ; }
Define model events.

@return void
Define model events .