appdezign/lara-pro-cms
Lara Pro CMS 10 is a flexible content management system built on Laravel by Firmaq Media. Includes a developer guide and documentation at https://docs.laracms.nl/ for setup, customization, and extension.
Installation:
composer require appdezign/lara-pro-cms
php artisan laracms:install
Follow prompts to configure database, admin user, and basic settings.
First Use Case:
/admin)./pages/{slug} to verify rendering./api/pages) to confirm JSON output.Key Files to Inspect:
config/laracms.php: Core configuration (content types, media settings).app/Providers/LaracmsServiceProvider.php: Service bindings and bootstrapping.resources/views/vendor/laracms/: Default Blade templates (override as needed).database/migrations/laracms_*: Schema for content types, media, and users.Documentation:
php artisan make:laracms-content-type to create custom types (e.g., Product, Event).
Example:
// app/Laracms/ContentTypes/Product.php
namespace App\Laracms\ContentTypes;
use Appdezign\Laracms\ContentTypes\ContentType;
class Product extends ContentType
{
public static function fields(): array
{
return [
'title' => 'string',
'price' => 'decimal',
'images' => 'media', // Uses Spatie Media Library
'categories' => 'belongsToMany:Category',
];
}
}
string, text, media, belongsTo, etc.) or create custom ones by extending Appdezign\Laracms\Fields\Field.php artisan vendor:publish --tag="laracms-filament-resources"
Edit resources/views/vendor/laracms/filament/ to customize forms/tables.// app/Providers/LaracmsServiceProvider.php
public function boot()
{
Filament::registerPlugin(
new class extends Plugin {
public static function getNavigationIcon(): string
{
return 'heroicon-o-cog';
}
public static function getNavigationGroup(): ?string
{
return 'Settings';
}
public static function getNavigationLabel(): string
{
return 'Custom Tool';
}
}
);
}
@laracms directives to render content:
@laracms('page', 'homepage')
<h1>{{ $content->title }}</h1>
{!! $content->body !!}
@endlaracms
// Example: Fetch a page via React/Vue
const response = await fetch('/api/pages/homepage');
const page = await response.json();
<livewire:laracms-content type="blog_post" id="{{ $post->id }}" />
config/laracms.php:
'media' => [
'driver' => 'spatie',
'disk' => 'public',
],
Use the media field type in content types to attach files.routes/laracms.php:
Route::get('/custom-path', [\Appdezign\Laracms\Http\Controllers\PageController::class, 'show'])
->name('laracms.custom-page');
routes/api.php:
Route::apiResource('custom-content', \App\Laracms\Http\Controllers\CustomContentController::class);
laravel-translatable or Spatie’s package:
// In a content type field
'title' => [
'type' => 'string',
'translatable' => true,
],
Configure locales in config/app.php and config/laracms.php.// config/laracms.php
'auth' => [
'driver' => 'sanctum',
],
use Appdezign\Laracms\Jobs\ProcessContent;
ProcessContent::dispatch($content)->onQueue('laracms');
ContentPublished):
// app/Providers/EventServiceProvider.php
protected $listen = [
\Appdezign\Laracms\Events\ContentPublished::class => [
\App\Listeners\SendNotification::class,
],
];
// Inertia/Vue example
const page = await Inertia.get('/pages/homepage');
<div x-data="{ open: false }">
<button @click="open = true">Edit</button>
<livewire:edit-content wire:key="content-{{ $id }}" :content="$content" x-show="open" />
</div>
Route::middleware(['cache.headers:public;max_age=2592000'])->group(function () {
Route::apiResource('pages', \Appdezign\Laracms\Http\Controllers\PageController::class);
});
lazy collections for large datasets:
$posts = Post::query()->lazy()->paginate(10);
wire:ignore or wire:key to optimize.app/Providers/LaracmsServiceProvider.php for plugin registration order.Schema::hasTable() fails or duplicate columns.php artisan laracms:migrate --force or inspect database/migrations/laracms_* before custom migrations.SoftDeletes by default. Disable in models if needed:
use Illuminate\Database\Eloquent\SoftDeletes;
class Post extends Model
{
use SoftDeletes; // Remove if not needed
}
/admin, /api, and /pages. Override carefully:
// routes/web.php
Route::prefix('custom-admin')->group(function () {
\Appdezign\Laracms\Http\Controllers\AdminController::class;
});
Route::namespace() or Route::prefix() to isolate routes.config/filesystems.php matches config/laracms.php media settings.
php artisan storage:link
post_max_size and upload_max_filesize in php.ini ifHow can I help you explore Laravel packages today?