You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the isValidStatus() method in my model, which extends Spatie\ModelStatus\Status, but my custom function is not working.
<?php
namespace App\Models;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Spatie\ModelStatus\HasStatuses;
use Spatie\ModelStatus\Status as SpatieModelStatus;
class StatusHook extends SpatieModelStatus
{
use HasStatuses;
public function isValidStatus(string $name, ?string $reason = null): bool
{
return StatusType::where('slug', $name)->exists();
}
}
This discussion was converted from issue #114 on February 13, 2024 16:49.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using the isValidStatus() method in my model, which extends Spatie\ModelStatus\Status, but my custom function is not working.
Beta Was this translation helpful? Give feedback.
All reactions