chore: add larastan

This commit is contained in:
Benjamin Nussbaum 2025-06-17 22:18:20 +02:00
parent c1a4acc40a
commit 1122764333
8 changed files with 209 additions and 4 deletions

View file

@ -142,6 +142,7 @@ class Device extends Model
public function getNextPlaylistItem(): ?PlaylistItem
{
// Get all active playlists
/** @var \Illuminate\Support\Collection|Playlist[] $playlists */
$playlists = $this->playlists()
->where('is_active', true)
->get();

View file

@ -60,6 +60,7 @@ class Playlist extends Model
}
// Get active playlist items ordered by display order
/** @var \Illuminate\Support\Collection|PlaylistItem[] $playlistItems */
$playlistItems = $this->items()
->where('is_active', true)
->orderBy('order')

View file

@ -2,6 +2,7 @@
namespace App\Models;
use Exception;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -138,7 +139,9 @@ class PlaylistItem extends Model
{
if (! $this->isMashup()) {
return view('trmnl-layouts.single', [
'slot' => $this->plugin->render('full', false),
'slot' => $this->plugin instanceof Plugin
? $this->plugin->render('full', false)
: throw new Exception('Invalid plugin instance'),
])->render();
}