{"id":15654915,"url":"https://github.com/unicodeveloper/laravel-software-install","last_synced_at":"2025-05-01T09:57:07.878Z","repository":{"id":87983962,"uuid":"53511052","full_name":"unicodeveloper/laravel-software-install","owner":"unicodeveloper","description":"Laravel Software Install Script Template - Most especially awesome for Open Source Projects","archived":false,"fork":false,"pushed_at":"2016-03-09T18:53:12.000Z","size":46,"stargazers_count":25,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-01T09:57:00.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unicodeveloper.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-09T15:58:55.000Z","updated_at":"2022-09-06T04:30:42.000Z","dependencies_parsed_at":"2023-03-03T04:30:26.652Z","dependency_job_id":null,"html_url":"https://github.com/unicodeveloper/laravel-software-install","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-software-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-software-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-software-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unicodeveloper%2Flaravel-software-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unicodeveloper","download_url":"https://codeload.github.com/unicodeveloper/laravel-software-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251856992,"owners_count":21655119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:54:51.331Z","updated_at":"2025-05-01T09:57:07.838Z","avatar_url":"https://github.com/unicodeveloper.png","language":"PHP","readme":"# Laravel Software Install Script Template/Process\n\nMany developers find it kinda confusing at first on how to go about creating install scripts for clients or users of open source projects. This is a simple template/step-by-step process to help you accomplish that. You can fork, contribute to it or just copy the template/process into your app and improve on it based on your specific need.\n\nIt has to do with creating a custom artisan command. If you are not sure how to go about that, please check this comprehensive [blog post](http://goodheads.io/2015/12/18/how-to-create-a-custom-artisan-command-in-laravel-5/)\n\n## Stey by Step Process\n\n1. Open your Terminal and Run the command:\n\n```bash\n    php artisan make:console Install\n```\n\nThis creates a file called `Install.php` in the `app/Console/Commands` directory.\n\n2. Open the file `Install.php` and dump this:\n\n```php\n\u003c?php\n\nnamespace App\\Console\\Commands;\n\nuse DB;\nuse Exception;\nuse Illuminate\\Console\\Command;\nuse Illuminate\\Support\\Facades\\Artisan;\n\nclass Install extends Command\n{\n    /**\n     * The name and signature of the console command.\n     *\n     * @var string\n     */\n    protected $signature = 'software:install';\n\n    /**\n     * The console command description.\n     *\n     * @var string\n     */\n    protected $description = 'Install this software without issues, Thanks!';\n\n    /**\n     * Create a new command instance.\n     *\n     * @return void\n     */\n    public function __construct()\n    {\n        parent::__construct();\n    }\n\n    /**\n     * Execute the console command.\n     *\n     * @return mixed\n     */\n    public function handle()\n    {\n\n        try {\n            DB::connection();\n        } catch (Exception $e) {\n            $this-\u003eerror('Unable to connect to database.');\n            $this-\u003eerror('Please fill valid database credentials into .env and rerun this command.');\n            return;\n        }\n\n        $this-\u003ecomment('Attempting to install Software - 1.0.0');\n\n        if (! env('APP_KEY')) {\n            $this-\u003einfo('Generating app key');\n            Artisan::call('key:generate');\n        } else {\n            $this-\u003ecomment('App key exists -- skipping...');\n        }\n\n        $this-\u003einfo('Migrating database...');\n\n        Artisan::call('migrate', ['--force' =\u003e true]);\n\n        $this-\u003ecomment('Database Migrated Successfully...');\n\n        $this-\u003einfo('Seeding DB data...');\n\n        Artisan::call('db:seed', ['--force' =\u003e true]);\n\n        $this-\u003ecomment('Database Seeded Successfully...');\n        $this-\u003ecomment('Successfully Installed! You can now run the software');\n    }\n}\n```\n\nBy adding this, a user can now run `php artisan software:install` from the terminal.\n\nThe code goes from:\n\n- ensuring the user has a database on standby with valid database credentials\n- to generating app key\n- to Migrating the database scripts ( migration files)\n- to seeding the database with data ( ensure you have the seeder classes all set up, an example is in this repo)\n\nThis process captures the basic install process every user usually goes through in just one script, you can definitely add/improve on it.\n\n## Example User Install Instruction to be given by Developer\n\n- Clone the repo e.g git clone https://github.com/unicodeveloper/laravel-software-install\n- Run Composer Install\n- Fill the right database credentials in the .env file\n- Run `php artisan software:install`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Flaravel-software-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funicodeveloper%2Flaravel-software-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodeveloper%2Flaravel-software-install/lists"}