PHP code example of sthira-labs / laravel-deployments
1. Go to this page and download the library: Download sthira-labs/laravel-deployments 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/ */
sthira-labs / laravel-deployments example snippets
namespace App\Deployments;
use SthiraLabs\LaravelDeployments\Deployment;
use Illuminate\Support\Facades\DB;
class PatAutomation extends Deployment
{
public function summary(): array
{
return [
'Run User seeder',
'Assign permissions to Admin role',
];
}
protected function handle(): void
{
$this->write(
fn () => DB::table('users')->update(['active' => true]),
'Activate all users'
);
}
protected function rollback(): void
{
DB::table('users')->update(['active' => false]);
}
}