https://github.com/skobel/laravel-install-command
Configurable install command for Laravel. Simply define your application installation steps so you can deploy your project more easily.
https://github.com/skobel/laravel-install-command
artisan artisan-command installation-script laravel laravel-framework
Last synced: about 1 year ago
JSON representation
Configurable install command for Laravel. Simply define your application installation steps so you can deploy your project more easily.
- Host: GitHub
- URL: https://github.com/skobel/laravel-install-command
- Owner: Skobel
- License: mit
- Created: 2019-10-19T06:43:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-20T13:54:46.000Z (over 6 years ago)
- Last Synced: 2025-02-03T14:12:06.026Z (about 1 year ago)
- Topics: artisan, artisan-command, installation-script, laravel, laravel-framework
- Language: PHP
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Artisan Install Command
### Introduction
Use this package to define your application's installation steps,
so you can deploy your Laravel project more easily.

### Installation
Install using composer:
```
composer require skobel/laravel-install-command
```
Laravel should automatically discover the service provider.
### Quickstart
Follow these steps to get started quickly.
Run the setup command:
```
php artisan installer:setup
```
This will create the following files and directories in your `app` folder:
```
Installation/
Steps/
Configuration.php
```
In the newly created `Configuration.php` you can define your installation steps.
There are a few default steps available out of the box.
```
class Configuration extends \Skobel\LaravelInstallCommand\Configuration
{
public function steps(): array
{
return [
//new CopyDotEnvFile,
//new GenerateApplicationKey,
//new RunMigrations,
//new SeedDatabase,
];
}
}
```
Begin installation:
```
php artisan install
```
### Available Steps
| Class name | Description |
| ------------------------- | ------------- |
| CopyDotEnvFile | Copy .env.example to .env
| GenerateApplicationKey | Run `php artisan key:generate`
| RunMigrations | Run your migrations with the `--force` option
| SeedDatabase | Seed your database with the `--force` option
| CreatePassportKeys | Run `php artisan passport:keys`, use only if you have Laravel Passport installed
### Creating Installation Steps
```
php artisan installer:step StepName
```
This will generate a Step class with the given name. Next add this Step to your `steps` array in your configuration:
```
use App\Installation\Steps\StepName;
class Configuration extends \Skobel\LaravelInstallCommand\Configuration
{
public function steps(): array
{
return [
// ...
new StepName,
];
}
}
```
### Custom Configuration and Directory Structure
Of course you can place your configuration class and installation steps wherever you want. After you have
your configuration class at a custom location add the following code to your `AppServiceProvider`'s boot method.
```
use App\Installation\Configuration;
// ...
public function boot()
{
Installer::use(new Configuration);
}
```