#!/bin/bash # Exit on any error set -e echo "Starting..." # --- echo "Laravel: Create SQLite database" touch database/database.sqlite # --- echo "Laravel: Remove cache table migration" rm -f database/migrations/0001_01_01_000001_create_cache_table.php # --- echo "Laravel: Use file cache store" php -r "require 'vendor/autoload.php'; (new \Illuminate\Filesystem\Filesystem)->replaceInFile('CACHE_STORE=database', 'CACHE_STORE=file', '.env');" # --- echo "Laravel: API setup" php artisan install:api # --- echo "Laravel: Remove front-end files" WEB_ROUTES_LINE=" web: __DIR__.'/../routes/web.php',\n" php -r "require 'vendor/autoload.php'; (new \Illuminate\Filesystem\Filesystem)->replaceInFile(\"$WEB_ROUTES_LINE\", '', 'bootstrap/app.php');" rm -rf resources rm -f package.json rm -f vite.config.js rm -f routes/web.php # --- echo "Laravel: Remove default feature test" rm -f tests/Feature/ExampleTest.php # --- echo "Duster: Install" composer require tightenco/duster --dev # --- echo "Pest: Install Faker plugin" composer require pestphp/pest-plugin-faker --dev # --- echo "Blueprint: Install" composer require -W --dev laravel-shift/blueprint # --- echo "Blueprint: Install Additional Assertions" composer require --dev jasonmccreary/laravel-test-assertions # --- echo "Blueprint: Publish config" php artisan vendor:publish --tag=blueprint-config # --- echo "Blueprint: Generate Pest tests instead of PhpUnit tests" php -r "require 'vendor/autoload.php'; (new \Illuminate\Filesystem\Filesystem)->replaceInFile('PhpUnitTestGenerator', 'PestTestGenerator', 'config/blueprint.php');" # --- echo "Blueprint: Ignore .blueprint file" echo '/.blueprint' >> .gitignore # --- echo "Blueprint: Save Gist as draft.yaml" curl https://gist.githubusercontent.com/nicodevs/0e889f237161010f478af66e164c79df/raw -o draft.yaml # --- echo "Blueprint: Build" php artisan blueprint:build # --- echo "Laravel: Migrate fresh and seed" php artisan migrate:fresh --seed # --- echo "Duster: Fix" ./vendor/bin/duster fix # --- echo "Done!"