Skip to content

Instantly share code, notes, and snippets.

View vladimir-zarcanin's full-sized avatar

vladimir-zarcanin

View GitHub Profile
@vladimir-zarcanin
vladimir-zarcanin / Post.php
Last active April 19, 2022 13:20
Laravel automatically create unique slug on model created.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasFactory, UniqueSlug;