{"id":19719524,"url":"https://github.com/qruto/laravel-flora","last_synced_at":"2025-04-05T18:09:43.400Z","repository":{"id":124569097,"uuid":"602344492","full_name":"qruto/laravel-flora","owner":"qruto","description":"Install and update Laravel application with single command","archived":false,"fork":false,"pushed_at":"2024-07-08T16:50:56.000Z","size":5501,"stargazers_count":117,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-29T16:21:10.734Z","etag":null,"topics":["command","deploy","install","laravel","php","setup","update"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qruto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"qruto","custom":"send.monobank.ua/jar/3eG4Vafvzq"}},"created_at":"2023-02-16T02:18:15.000Z","updated_at":"2024-09-18T05:10:50.000Z","dependencies_parsed_at":"2023-07-08T19:01:45.084Z","dependency_job_id":"fa6cbf83-d12d-4c22-a02e-75ee89334461","html_url":"https://github.com/qruto/laravel-flora","commit_stats":{"total_commits":321,"total_committers":8,"mean_commits":40.125,"dds":0.5202492211838006,"last_synced_commit":"d556410a04add1f85ea52256c4512c9cc55bd2ea"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qruto%2Flaravel-flora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qruto%2Flaravel-flora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qruto%2Flaravel-flora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qruto%2Flaravel-flora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qruto","download_url":"https://codeload.github.com/qruto/laravel-flora/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247006815,"owners_count":20868076,"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":["command","deploy","install","laravel","php","setup","update"],"created_at":"2024-11-11T23:08:35.566Z","updated_at":"2025-04-05T18:09:43.376Z","avatar_url":"https://github.com/qruto.png","language":"PHP","funding_links":["https://github.com/sponsors/qruto","send.monobank.ua/jar/3eG4Vafvzq"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cpicture\u003e\n        \u003csource\n            width=\"350\"\n            media=\"(prefers-color-scheme: dark)\"\n            srcset=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/logo-dark.png\"\n        \u003e\n        \u003csource\n            width=\"350\"\n            media=\"(prefers-color-scheme: light)\"\n            srcset=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/logo-light.png\"\n        \u003e\n        \u003cimg\n            width=\"350\"\n            alt=\"Laravel Flora Logo\"\n            src=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/logo-light.png\"\n        \u003e\n    \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eA convenient way to automate \u003cstrong\u003esetup\u003c/strong\u003e of your application.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cpicture\u003e\n        \u003csource\n            width=\"450\"\n            media=\"(prefers-color-scheme: dark)\"\n            srcset=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/code-example-dark.svg\"\n        \u003e\n        \u003csource\n            width=\"450\"\n            media=\"(prefers-color-scheme: light)\"\n            srcset=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/code-example-light.svg\"\n        \u003e\n        \u003cimg\n            width=\"450\"\n            alt=\"Laravel Flora Code Example\"\n            src=\"https://github.com/qruto/laravel-flora/raw/HEAD/art/code-example-light.svg\"\n        \u003e\n    \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/qruto/laravel-flora/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://github.com/qruto/laravel-flora/actions/workflows/tests.yml/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/qruto/laravel-flora/actions/workflows/styles.yml\"\u003e\u003cimg src=\"https://github.com/qruto/laravel-flora/actions/workflows/styles.yml/badge.svg\" alt=\"Styles check\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/qruto/laravel-flora/actions/workflows/types.yml\"\u003e\u003cimg src=\"https://github.com/qruto/laravel-flora/actions/workflows/types.yml/badge.svg\" alt=\"Types check\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/qruto/laravel-flora/actions/workflows/refactor.yml\"\u003e\u003cimg src=\"https://github.com/qruto/laravel-flora/actions/workflows/refactor.yml/badge.svg\" alt=\"Refactor code\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/qruto/laravel-flora\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/qruto/laravel-flora\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/qruto/laravel-flora\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/qruto/laravel-flora\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"650\" alt=\"Laravel Flora Demo\" src=\"/art/demo.png\" /\u003e\n\u003c/p\u003e\n\n## Goal\n\nThe main goal of _Flora_ is define and automate the setup process of Laravel application.\nAll necessary actions to make the application ready to work in one place.\n\nPackages discovering, assets building and publishing, running database migrations, caching etc...\n\n\u003e 🧠🚀 Put the knowledge of setup instructions at the application level.\n\n## Introduction\n\nRevival of [Laravel Initializer](https://laravel-news.com/automate-app-setup-with-laravel-initializer). Rethinked, improved, prettified, renamed.\n\n_Flora_ allows you to bring Laravel application to live by one command.\nUse default or define custom chain of actions required to **install** or **update** an application.\n\nRun `install` when you fetch a fresh application to prepare it to launch on new environment.\n\n- after `git clone`\n\nRun `update` on every dependency or source code change.\n\n- after `composer install|update`\n- after `git pull|checkout|megre|...`\n- in deploy script\n- in CI/CD pipeline\n\nit will take care of the rest of the work.\n\n## Support\n\nSince of February 24, unfortunately I haven't any commercial work, permanent living place or the ability to plan anything for the long term. However, I have a greater desire to continue creating useful solutions for people around the world. It makes me feel better these days.\n\n[![support me](https://raw.githubusercontent.com/slavarazum/slavarazum/main/support-banner.png)](https://github.com/sponsors/qruto)\n\n[GitHub Sponsorships profile](https://github.com/sponsors/qruto) is ready! There you can find current work, future plans, goals and dreams...\nYour stars make me happier each day ❤️ ⭐ Sponsorship will enable us to live more peacefully and continue to work on useful solutions for you.\n\nI would be very grateful for mentions or just a sincere \"thank you\".\n\n💳 [Sponsoring directly to savings jar](https://send.monobank.ua/jar/3eG4Vafvzq) with card or Apple Pay/Google Pay.\n\n## Installation\n\nVia Composer:\n\n``` bash\ncomposer require qruto/laravel-flora\n```\n\n## Usage\n\nReplace ~~**installation**~~ section in readme file with:\n\n```bash\nphp artisan install\n```\n\nRefresh application state by:\n\n```bash\nphp artisan update\n```\n\n\u003e ℹ️ Instruction depends on current **environment**. Package has predefined actions suitable for most cases.\n\nSee detailed output in verbosity mode:\n\n```bash\nphp artisan app:update -v\n```\n\nYou can automate the update process by adding `@php artisan update` command to your application\n`composer.json` script `post-autoload-dump` section and remove\ndefault `vendor:publish` command from `post-update-cmd` section.\n`update` command will take care of assets publishing for you.\n\nSetup it with:\n\n```bash\nphp artisan flora:setup --script\n```\n\n`composer.json` changes:\n\n```diff\n\"post-autoload-dump\": [\n    \"Illuminate\\\\Foundation\\\\ComposerScripts::postAutoloadDump\", \n-     \"@php artisan package:discover --ansi\"\n+     \"@php artisan update\"\n],\n- \"post-update-cmd\": [\n-     \"@php artisan vendor:publish --tag=laravel-assets --ansi --force\"\n- ],\n```\n\n### Register Task Scheduler\n\nConditions:\n- any scheduler task registered\n- installation process performed\n- application in production environment\n\nthen you will be prompted for the addition of a cron entry to [run the task scheduler every minute](https://laravel.com/docs/master/scheduling#running-the-scheduler).\n\n![Task Scheduler](https://github.com/qruto/laravel-flora/raw/HEAD/art/task-scheduling.png)\n\n## Configuration\n\nTo customize instructions for each environment, you need to publish setup files.\n\n```bash\nphp artisan flora:setup\n```\n\nThis command will create `routes/setup.php` file with predefined instructions for `local` and `production` environments.\n\n```php\nuse Qruto\\Flora\\Run;\n\nApp::install('local', fn (Run $run) =\u003e $run\n    -\u003ecommand('key:generate')\n    -\u003ecommand('migrate')\n    -\u003ecommand('storage:link')\n    -\u003escript('build')\n);\n\nApp::install('production', fn (Run $run) =\u003e $run\n    -\u003ecommand('key:generate', ['--force' =\u003e true])\n    -\u003ecommand('migrate', ['--force' =\u003e true])\n    -\u003ecommand('storage:link')\n    -\u003escript('cache')\n    -\u003escript('build')\n);\n\nApp::update('local', fn (Run $run) =\u003e $run\n    -\u003ecommand('migrate')\n    -\u003ecommand('cache:clear')\n    -\u003escript('build')\n);\n\nApp::update('production', fn (Run $run) =\u003e $run\n    -\u003escript('cache')\n    -\u003ecommand('migrate', ['--force' =\u003e true])\n    -\u003ecommand('cache:clear')\n    -\u003ecommand('queue:restart')\n    -\u003escript('build')\n);\n```\n\nFeel free to change it any way you need or add specific environment like `staging`.\n\n\u003cdetails\u003e\n\n\u003csummary\u003e`build` and `cache` script details\u003c/summary\u003e\n\n`build` script contains assets building commands:\n\n```bash\nnpm install\nnpm run build\n```\n\n`cache` script provides general application caching:\n\n```bash\nphp artisan route:cache\nphp artisan config:cache\nphp artisan event:cache\n```\n\u003c/details\u003e\n\nIn addition, it will create `config/flora.php` for configuration assets publishing.\n\n```php\nreturn [\n    /*\n    |--------------------------------------------------------------------------\n    | Force Assets Publish\n    |--------------------------------------------------------------------------\n    |\n    | Force publish assets on every installation or update. By default, assets\n    | will always be force published, which would completely automate the\n    | setup. Switch it to false if you want to manually publish assets.\n    | For example if you prefer to commit them.\n    */\n    'force_publish' =\u003e true,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Publishable Assets\n    |--------------------------------------------------------------------------\n    |\n    | List of assets that will be published during installation or update.\n    | Most of required assets detects on the way. If you need specific\n    | tag or provider, feel free to add it to the array.\n    */\n    'assets' =\u003e [\n        'laravel-assets',\n    ],\n];\n```\n\nIf you need to customize just assets publishing, you can publish only configuration file:\n\n```bash\nphp artisan vendor:publish --tag=flora-config\n```\n\n### Side Packages Support\n\n_Flora_ automatically detects several packages for performing necessary actions on install or update.\nFor example: publish Vapor UI assets, generate IDE helper files, terminate Horizon workers etc.\n\nSupported:\n\n- [Laravel Vapor Ui](https://github.com/laravel/vapor-ui)\n- [Laravel Horizon](https://github.com/laravel/horizon)\n- [IDE Helper for Laravel](https://github.com/barryvdh/laravel-ide-helper)\n\nSoon:\n\n- [ ] [Laravel Octane](https://laravel.com/docs/10.x/octane#reloading-the-workers)\n- [ ] [Laravel Nova](https://nova.laravel.com/docs/4.0/installation.html#updating-nova-s-assets)\n- [ ] [Laravel Passport](https://laravel.com/docs/10.x/passport#deploying-passport)\n\n### Custom Scripts\n\nOverride or define custom script in service provider's `boot` method:\n\n```php\nRun::newScript('cache', fn (Run $run) =\u003e $run\n    -\u003ecommand('route:cache')\n    -\u003ecommand('config:cache')\n    -\u003ecommand('event:cache')\n    -\u003ecommand('view:cache')\n);\n```\n\n### Available Actions\n\n```php\n$run\n    -\u003ecommand('command') // Run artisan command\n    -\u003escript('build') // Perform custom script\n    -\u003eexec('process') // Execute external process\n    -\u003ejob(new JobClass) // Dispatch job\n    -\u003ecall(fn () =\u003e makeSomething()) // Call callable function \n    -\u003enotify('Done!') // Send notification\n```\n\n## Upgrading\n\nPlease see [UPGRADING](UPGRADING.md) for details.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CODE_OF_CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email bro@qruto.to instead of using the issue tracker.\n\n## Credits\n\nThanks [Nuno Maduro](https://github.com/nunomaduro) for [laravel-desktop-notifier](https://github.com/nunomaduro/laravel-desktop-notifier) package which brings desktop notifications to Laravel.\n\n- [Qruto](https://github.com/qruto)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[link-author]: https://github.com/qruto\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqruto%2Flaravel-flora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqruto%2Flaravel-flora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqruto%2Flaravel-flora/lists"}