Installation
composer require soysaltan/marygen
Publish the config file (if needed):
php artisan vendor:publish --provider="Marygen\MarygenServiceProvider"
Basic Usage Generate a MaryUI page with a single command:
php artisan marygen:page PageName
This creates a new page in resources/views/maryui/pages/ with a scaffolded layout.
First Use Case
php artisan marygen:page dashboard
resources/views/maryui/pages/dashboard.blade.php and customize the content between the <maryui-content> tags.Page Generation
marygen:page for new pages, marygen:component for reusable components.php artisan marygen:page settings --type=form
Component-Based Development
resources/views/maryui/components/ and modifying.php artisan marygen:component custom-card
Blade Integration
@maryui('components.card', ['title' => 'Hello', 'content' => 'World'])
API-Driven Pages
marygen:page with --api flag to scaffold API-backed pages:
php artisan marygen:page user-profile --api
app/Http/Controllers/Maryui/.Theming
php artisan vendor:publish --tag=marygen-assets
resources/css/maryui/custom.css.Namespace Conflicts
MarygenServiceProvider is registered in config/app.php before use.config/marygen.php:
'namespace' => 'App\\Maryui',
Component Overrides
vendor/. Instead, copy and extend:
cp vendor/soysaltan/marygen/resources/views/maryui/components/button.blade.php resources/views/maryui/components/
Route Conflicts
--api pages. Manually define routes in routes/web.php if needed:
Route::maryui('dashboard')->uses('DashboardController');
Asset Loading
marygen:assets is published and included in resources/js/app.js:
import 'maryui/dist/css/maryui.css';
View Not Rendering?
resources/views/maryui/layouts/app.blade.php for missing @yield sections.config/maryui.php:
'pages' => [
'dashboard' => 'pages.dashboard',
],
Component Not Found
php artisan marygen:list to verify available components.php artisan view:clear
Custom Logic
app/Http/Controllers/Maryui/GeneratedController.php.namespace App\Http\Controllers\Maryui;
use Marygen\Controllers\GeneratedController as BaseController;
class DashboardController extends BaseController {
public function __construct() {
$this->middleware('auth');
}
}
Custom Page Types
php artisan make:command MarygenCustomPage
generate() method in app/Console/Commands/MarygenCustomPage.php.Dynamic Data
@maryui directives with dynamic data:
@maryui('components.table', [
'headers' => $headers,
'rows' => $data
])
Localization
resources/lang/en/maryui.php:
return [
'dashboard' => [
'title' => 'My Custom Dashboard',
],
];
How can I help you explore Laravel packages today?