PHP code example of brainstud / laravel-deployment-scripts

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

    

brainstud / laravel-deployment-scripts example snippets


return new class extends DeploymentScript {
	public function up()
	{
		$this->command('mycommand:trigger');

		$this->query('UPDATE `table` SET `foo` = 1 WHERE `baz` IS NULL');
	}
	
	public function down()
	{
		$this->closure(function () {
			(new CustomActionClass())->execute();
		});
	}
} 

return [
    'table_name' => 'deployment_scripts_log',
];
bash
php artisan vendor:publish --tag="deployment-scripts-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="deployment-scripts-config"