-
-
Save uno-de-piera/aee5cd7cf045e085b2e23b90cf36e007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function boot () { | |
parent::boot(); | |
static::saving(function(Course $course) { | |
if( ! \App::runningInConsole() ) { | |
$course->slug = str_slug($course->name, "-"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment