PHP code example of tomaszboloz / laravel-updater

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

    

tomaszboloz / laravel-updater example snippets


use Illuminate\Support\Facades\Gate;

Gate::define('updater.manage', fn ($user) => $user->hasRole('super_admin'));

use TomaszBoloz\LaravelUpdater\Filament\UpdaterPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(
            UpdaterPlugin::make()
                ->navigationGroup('Settings')
                ->navigationSort(90),
        );
}

// routes/console.php
Schedule::command('updater:run --force')->dailyAt('03:00')->withoutOverlapping();

'steps' => [
    ['@composer', 'install', '--no-dev', '--no-interaction', '--prefer-dist', '--optimize-autoloader'],
    ['@php', 'artisan', 'migrate', '--force'],
    ['@npm', 'ci', '--no-audit', '--no-fund'],
    ['@npm', 'run', 'build'],
    ['@php', 'artisan', 'optimize:clear'],
    ['@php', 'artisan', 'optimize'],
    ['@php', 'artisan', 'queue:restart'],
    // ['@php', 'artisan', 'filament:optimize'],
    // ['@php', 'artisan', 'backup:run', '--only-db'],
],