PHP code example of qruto / laravel-flora

1. Go to this page and download the library: Download qruto/laravel-flora 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/ */

    

qruto / laravel-flora example snippets


use Qruto\Flora\Run;

App::install('local', fn (Run $run) => $run
    ->command('key:generate')
    ->command('migrate')
    ->command('storage:link')
    ->script('build')
);

App::install('production', fn (Run $run) => $run
    ->command('key:generate', ['--force' => true])
    ->command('migrate', ['--force' => true])
    ->command('storage:link')
    ->script('cache')
    ->script('build')
);

App::update('local', fn (Run $run) => $run
    ->command('migrate')
    ->command('cache:clear')
    ->script('build')
);

App::update('production', fn (Run $run) => $run
    ->script('cache')
    ->command('migrate', ['--force' => true])
    ->command('cache:clear')
    ->command('queue:restart')
    ->script('build')
);

return [
    /*
    |--------------------------------------------------------------------------
    | Force Assets Publish
    |--------------------------------------------------------------------------
    |
    | Force publish assets on every installation or update. By default, assets
    | will always be force published, which would completely automate the
    | setup. Switch it to false if you want to manually publish assets.
    | For example if you prefer to commit them.
    */
    'force_publish' => true,

    /*
    |--------------------------------------------------------------------------
    | Publishable Assets
    |--------------------------------------------------------------------------
    |
    | List of assets that will be published during installation or update.
    | Most of 

Run::newScript('cache', fn (Run $run) => $run
    ->command('route:cache')
    ->command('config:cache')
    ->command('event:cache')
    ->command('view:cache')
);

$run
    ->command('command') // Run artisan command
    ->script('build') // Perform custom script
    ->exec('process') // Execute external process
    ->job(new JobClass) // Dispatch job
    ->call(fn () => makeSomething()) // Call callable function 
    ->notify('Done!') // Send notification
bash
php artisan install
bash
php artisan update
bash
php artisan app:update -v
bash
php artisan flora:setup --script
diff
"post-autoload-dump": [
    "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 
-     "@php artisan package:discover --ansi"
+     "@php artisan update"
],
- "post-update-cmd": [
-     "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
- ],
bash
php artisan flora:setup
bash
php artisan route:cache
php artisan config:cache
php artisan event:cache
bash
php artisan vendor:publish --tag=flora-config