PHP code example of dev-lnk / moonshine-builder

1. Go to this page and download the library: Download dev-lnk/moonshine-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dev-lnk / moonshine-builder example snippets


return [
    'builds_dir' => base_path('builds')
];

public function fields(): array
{
    return [
        Block::make([
            ID::make('id'),
            Text::make('Name', 'name'),
            Text::make('Email', 'email'),
            Date::make('EmailVerifiedAt', 'email_verified_at'),
            Text::make('Password', 'password'),
            Text::make('RememberToken', 'remember_token'),
        ]),
    ];
}
shell
php artisan vendor:publish --tag=moonshine-builder
shell
php artisan moonshine:build
shell
 php artisan moonshine:build category.json
shell
php artisan moonshine:build users --type=table
shell
php artisan moonshine:project-schema
shell
php artisan ms-build:resource Post
shell
 ┌ Add timestamps? ─────────────────────────────────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

 ┌ Add softDelete? ─────────────────────────────────────────────┐
 │ No                                                           │
 └──────────────────────────────────────────────────────────────┘

 ┌ Make migration? ─────────────────────────────────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘
 app/Models/Post.php was created successfully!
 app/MoonShine/Resources/PostResource.php was created successfully!
 migrations/2024_09_10_111121_create_posts.php was created successfully!
shell
php artisan ms-build:types