felipemateus/iptv-core
Laravel 9 package providing IPTV core features for Laravel apps, with database migrations and locale support (pt-BR, en). Note: this package has been moved to laravel-iptv-cms.
Installation
composer require felipemateus/iptv-core
php artisan migrate
First Use Case
Dashboard) to create custom admin panels:
use FelipeMateus\IPTVCore\Dashboard;
class CustomDashboard extends Dashboard
{
public function __construct()
{
parent::__construct();
$this->title = 'My IPTV Dashboard';
$this->menuItems = [
['route' => 'channels.index', 'label' => 'Channels'],
['route' => 'epg.index', 'label' => 'EPG'],
];
}
}
routes/web.php:
Route::get('/dashboard', [CustomDashboard::class, 'index']);
Key Files to Explore
resources/views/vendor/iptv-core/ – Base layouts and partials.FelipeMateus\IPTVCore\Dashboard – Core dashboard class.config/iptv-core.php – Configuration (e.g., menu structure, locales).Dashboard Class: Override methods like getMenuItems(), getTitle(), or getContent() to tailor the dashboard.
class AdminDashboard extends Dashboard
{
public function getContent()
{
return view('admin.dashboard.content');
}
}
$this->menuItems = collect([
['route' => 'channels.index', 'label' => 'Channels'],
['route' => fn() => route('stats'), 'label' => 'Analytics'],
]);
resources/views/vendor/iptv-core/layouts/app.blade.php). Extend it in your project:
@extends('iptv-core::layouts.app')
@section('content')
<!-- Custom content -->
@endsection
php artisan vendor:publish --tag=iptv-core-views
en (English) and br (Portuguese-Brazilian).php artisan vendor:publish --tag=iptv-core-lang
Then extend resources/lang/{locale}/iptv-core.php.use FelipeMateus\IPTVCore\BusinessFields\BusinessField;
$field = new BusinessField();
$field->name('custom_field')
->type('text')
->label('Custom Label')
->required();
iptv-channelsfelipemateus/iptv-channels for full IPTV functionality:
composer require felipemateus/iptv-channels
Dashboard class.Archived Package:
laravel-iptv-cms. Monitor for updates or fork if critical bugs arise.Asset Removal:
v1.2.0 or implement custom styling:
git checkout v1.2.0 -- resources/views/vendor/iptv-core/assets/
Laravel Version Quirks:
Dashboard class:
// Example: Fix route caching in Laravel 10+
protected function getRouteCache()
{
return app('router')->getRoutes()->getByName($this->route);
}
Migration Conflicts:
config table migration might conflict with existing setups. Publish and modify migrations:
php artisan vendor:publish --tag=iptv-core-migrations
Dashboard Not Loading:
Dashboard class is properly registered in routes and the index() method is defined:
public function index()
{
return view('iptv-core::dashboard')->with('dashboard', $this);
}
Menu Items Missing:
menuItems is an array of associative arrays with route and label keys. Use route names (not URLs) for consistency:
['route' => 'channels.index', 'label' => 'Channels'] // Correct
['route' => '/channels', 'label' => 'Channels'] // May fail
Localization Fallback:
config/app.php:
'fallback_locale' => 'en',
Custom Dashboard Components:
getContent() method:
public function getContent()
{
return view('iptv-core::dashboard.content', [
'widgets' => [
new ChannelStatsWidget(),
new RecentActivityWidget(),
],
]);
}
Business Field Validation:
BusinessField to add custom validation rules:
$field->rules(['unique:channels,name', 'max:50']);
Menu Item Permissions:
$this->menuItems = auth()->user()->can('access-dashboard')
? [['route' => 'dashboard', 'label' => 'Dashboard']]
: [];
Theme Support:
app.blade.php template:
php artisan vendor:publish --tag=iptv-core-views
How can I help you explore Laravel packages today?