Files
mtdb_movie/common/Channels/LoadChannelMenuItems.php
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

26 lines
598 B
PHP
Executable File

<?php
namespace Common\Channels;
use App\Models\Channel;
use Illuminate\Support\Collection;
class LoadChannelMenuItems
{
public function execute(): Collection
{
return Channel::limit(40)
->where('type', 'channel')
->get()
->map(
fn(Channel $channel) => [
'label' => $channel->name,
'action' => '/' . $channel->slug,
'type' => 'route',
'model_id' => $channel->id,
'id' => $channel->id,
],
);
}
}