Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Marygen Laravel Package

soysaltan/marygen

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require soysaltan/marygen
    

    Publish the config file (if needed):

    php artisan vendor:publish --provider="Marygen\MarygenServiceProvider"
    
  2. 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.

  3. First Use Case

    • Create a dashboard page:
      php artisan marygen:page dashboard
      
    • Open resources/views/maryui/pages/dashboard.blade.php and customize the content between the <maryui-content> tags.

Implementation Patterns

Workflow Integration

  1. Page Generation

    • Use marygen:page for new pages, marygen:component for reusable components.
    • Example: Generate a settings page with a form:
      php artisan marygen:page settings --type=form
      
  2. Component-Based Development

    • Extend existing components by copying from resources/views/maryui/components/ and modifying.
    • Example: Create a custom card component:
      php artisan marygen:component custom-card
      
  3. Blade Integration

    • Embed MaryUI components in existing Blade views:
      @maryui('components.card', ['title' => 'Hello', 'content' => 'World'])
      
  4. API-Driven Pages

    • Use marygen:page with --api flag to scaffold API-backed pages:
      php artisan marygen:page user-profile --api
      
    • This generates a page with CRUD logic stubs in app/Http/Controllers/Maryui/.
  5. Theming

    • Override default styles by publishing assets:
      php artisan vendor:publish --tag=marygen-assets
      
    • Modify resources/css/maryui/custom.css.

Gotchas and Tips

Common Pitfalls

  1. Namespace Conflicts

    • Ensure MarygenServiceProvider is registered in config/app.php before use.
    • If using custom namespaces, update config/marygen.php:
      'namespace' => 'App\\Maryui',
      
  2. Component Overrides

    • Avoid modifying core components in vendor/. Instead, copy and extend:
      cp vendor/soysaltan/marygen/resources/views/maryui/components/button.blade.php resources/views/maryui/components/
      
  3. Route Conflicts

    • Marygen auto-generates routes for --api pages. Manually define routes in routes/web.php if needed:
      Route::maryui('dashboard')->uses('DashboardController');
      
  4. Asset Loading

    • Ensure marygen:assets is published and included in resources/js/app.js:
      import 'maryui/dist/css/maryui.css';
      

Debugging Tips

  1. View Not Rendering?

    • Check resources/views/maryui/layouts/app.blade.php for missing @yield sections.
    • Verify the page is registered in config/maryui.php:
      'pages' => [
          'dashboard' => 'pages.dashboard',
      ],
      
  2. Component Not Found

    • Run php artisan marygen:list to verify available components.
    • Clear compiled views:
      php artisan view:clear
      
  3. Custom Logic

    • Extend controllers by overriding app/Http/Controllers/Maryui/GeneratedController.php.
    • Example:
      namespace App\Http\Controllers\Maryui;
      use Marygen\Controllers\GeneratedController as BaseController;
      
      class DashboardController extends BaseController {
          public function __construct() {
              $this->middleware('auth');
          }
      }
      

Extension Points

  1. Custom Page Types

    • Extend the generator by creating a custom command:
      php artisan make:command MarygenCustomPage
      
    • Override generate() method in app/Console/Commands/MarygenCustomPage.php.
  2. Dynamic Data

    • Use @maryui directives with dynamic data:
      @maryui('components.table', [
          'headers' => $headers,
          'rows' => $data
      ])
      
  3. Localization

    • Override translations in resources/lang/en/maryui.php:
      return [
          'dashboard' => [
              'title' => 'My Custom Dashboard',
          ],
      ];
      
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager