Installation:
composer require eminiarts/aura-cms
php artisan aura:install
Follow the interactive prompts to configure core settings (admin user, team structure, etc.).
First Resource:
php artisan aura:resource posts --fields="title:text,content:textarea,status:select:published,draft"
This generates a posts resource with basic fields and CRUD routes.
Access Admin Panel:
Visit /admin (or configured route) and log in with the admin credentials created during installation.
php artisan aura:resource blog-posts --fields="title:text,slug:slug,content:wysiwyg,published_at:datetime,featured_image:image"
slug to auto-generate from titlefeatured_image to allow multiple uploadsScaffolding:
php artisan aura:resource products --fields="name:text,price:decimal,sku:text,description:textarea,images:gallery,stock:integer"
Generates:
Product.php)Field Customization:
// In a service provider or custom field class
public function configure()
{
return [
'label' => 'Product Price',
'hint' => 'Enter price in USD',
'validation' => 'required|numeric|min:0',
'default' => 0.00,
];
}
Dynamic Field Logic:
// Conditional fields example
public function rules()
{
return [
'is_digital' => [
'type' => 'boolean',
'label' => 'Digital Product',
'show' => ['sku' => 'hidden'],
],
'sku' => [
'type' => 'text',
'label' => 'SKU',
'rules' => 'required|unique:products,sku',
'show' => ['is_digital' => false],
],
];
}
// config/aura.php
'teams' => [
'enabled' => true,
'default_team' => '1',
],
use Aura\Base\Traits\TeamScope;
class Product extends Model
{
use TeamScope;
}
// In a controller or Livewire component
$this->impersonateUser($team->users()->first());
php artisan aura:plugin seo-tools
// In AppServiceProvider
Aura::registerPlugin(new \App\Plugins\SeoToolsPlugin());
public function fields()
{
return [
'meta_title' => [
'type' => 'text',
'label' => 'SEO Title',
'resource' => 'posts',
],
'meta_description' => [
'type' => 'textarea',
'label' => 'SEO Description',
'resource' => 'posts',
],
];
}
Frontend Integration:
// Display resource data in a Blade view
@foreach($posts as $post)
<article>
<h2>{{ $post->title }}</h2>
<div>{!! $post->content !!}</div>
@if($post->featured_image)
<img src="{{ $post->featured_image->url }}" alt="{{ $post->title }}">
@endif
</article>
@endforeach
API Endpoints:
// routes/api.php
Route::get('/posts', [PostController::class, 'index'])
->middleware('auth:sanctum')
->middleware('can:view,post');
Custom Actions:
// In a resource definition
'actions' => [
'publish' => [
'label' => 'Publish',
'method' => 'POST',
'icon' => 'heroicon-o-paper-airplane',
'handler' => [PostActionHandler::class, 'handlePublish'],
],
],
Event Listeners:
// Listen for resource creation
public function handle(PostCreated $event)
{
// Send notification, update search index, etc.
}
Field Initialization:
Aura\Base\Fields\Field and is registered in config/aura.php under fields.Team Scoping:
TeamScope trait and the teams feature is enabled in config.Livewire Component Loading:
php artisan aura:publish
Permission Denied:
admin roleapp/Http/Kernel.phpMigration Conflicts:
php artisan aura:database-to-resources to generate resources from existing tables.Enable Debug Mode:
// config/aura.php
'debug' => env('APP_DEBUG', false),
This adds console logs and error boundaries.
Field Validation:
php artisan aura:field:validate to test field rules independently.Livewire Debugging:
{{ dd($this->data) }} to Livewire components to inspect form data.Database Queries:
DB::enableQueryLog();
// ... perform operations ...
dd(DB::getQueryLog());
Resource Storage:
posts table. To use custom tables:
// In resource definition
'table' => 'custom_posts',
Field Defaults:
'status' => [
'type' => 'select',
'options' => ['draft', 'published'],
'default' => 'draft',
],
Media Handling:
config/aura.php:
'media' => [
'disk' => 'public',
'optimize' => true,
'max_size' => '10MB',
],
Theme Customization:
php artisan aura:publish --theme
resources/views/vendor/aura.Custom Field Types:
// Create a new field class
namespace App\Fields;
use Aura\Base\Fields\Field;
class CustomField extends Field
{
public function render()
{
return view('aura::fields.custom', ['field' => $this]);
}
public function process($value)
{
// Custom processing logic
return $value;
}
}
Resource Actions:
// Register a custom action
Aura::extend('posts', function ($resource) {
$resource->actions()->add('custom_action', [
'label' => 'Custom Action',
'method' => 'POST',
'icon' => 'heroicon-o-star',
'handler' => function ($model) {
// Custom logic
},
]);
});
Plugin System:
namespace App\Plugins;
use Aura\Base\Plugins\Plugin;
class MyPlugin extends Plugin
{
public function boot()
{
// Add custom fields, resources, or middleware
}
}
How can I help you explore Laravel packages today?