blue-twilight/app/ModelObservers/AlbumObserver.php

22 lines
408 B
PHP
Raw Normal View History

<?php
namespace App\ModelObservers;
use App\Album;
class AlbumObserver
{
public function creating(Album $album)
{
// Re-generate the alias and path
$album->generateAlias();
$album->generateUrlPath();
}
public function updating(Album $album)
{
// Re-generate the alias and path
$album->generateAlias();
$album->generateUrlPath();
}
}