yellow-three/voyager
yellow-three/voyager is a small Laravel package extending Voyager admin tooling. It adds helper integrations and sensible defaults for quickly wiring admin panels into apps, with a lightweight footprint and simple configuration for common CRUD management tasks.
Installation
composer require yellow-three/voyager
php artisan voyager:install
php artisan voyager:assets
First Use Case
/admin to log in with the generated credentials./resources/docs (if published)./admin for pre-built UI./storage/database/voyager_breads.json (auto-generated CRUD settings).app/Http/Middleware/VoyagerAdminMiddleware.php (customize admin access).Model Integration (BREADs)
php artisan voyager:make-bread ModelName
/storage/database/voyager_breads.json or use the Settings > BREADs UI.tcg\Voyager\Traits\BreadTraits or use addColumn() in BreadServiceProvider.Customizing Views
resources/views/voyager/ (e.g., breads/create.blade.php).@include('voyager::multilingual.fields') for multilingual support.API & Frontend Sync
config/voyager.php (api_enabled = true).
Endpoints: /api/voyager/{model}./vendor/tcg/voyager/js/voyager.js) or fetch data via API.Media Management
/admin/media).many-to-many relationships or morph-to (for polymorphic).Permissions & Roles
if (Voyager::can('browse_content')) { ... }
VoyagerServiceProvider:
$this->app->bind('custom.service', function () { ... });
voyager.bread.added):
Event::listen('voyager.bread.added', function ($bread) { ... });
Database Migrations
voyager_users, voyager_roles, etc. Do not manually alter these.php artisan voyager:make-bread to scaffold BREADs.Asset Conflicts
php artisan voyager:assets --force
public/vendor/tcg/voyager/ permissions.Permission Caching
php artisan voyager:clear-cache
Multilingual Quirks
config/voyager.php has multilingual_support = true.php artisan voyager:translations
Model Relationships
id as the primary key. For UUIDs, override getKey() in your model:
public function getKey() { return $this->uuid; }
/admin/log-viewer to debug Voyager-related errors.config/voyager.php:
'debug' => env('APP_DEBUG', true),
/vendor/tcg/voyager/ assets.Custom BREAD Fields
addColumn() in BreadServiceProvider:
public function boot() {
$this->addColumn('posts', [
'type' => 'morph',
'name' => 'author',
'model' => 'User',
]);
}
Override Controllers
tcg\Voyager\Http\Controllers\BreadController:
namespace App\Http\Controllers;
use tcg\Voyager\Http\Controllers\BreadController as BaseController;
class CustomBreadController extends BaseController {
public function customMethod() { ... }
}
VoyagerServiceProvider:
$this->app->bind('voyager.bread.controller', function () {
return new \App\Http\Controllers\CustomBreadController();
});
Hooks & Filters
voyager.bread.read or voyager.bread.add events to modify data:
Event::listen('voyager.bread.read', function ($data, $model) {
$data->custom_field = 'modified';
return $data;
});
Custom Routes
routes/voyager.php:
Voyager::addRoute(['GET', 'POST'], 'custom', 'CustomController@method');
Theming
resources/sass/voyager/_variables.scss.npm run dev
How can I help you explore Laravel packages today?