Laravel project structure

Laravel project structure

Explorer

  • .git…
  • app
  • Jobsnew
  • bootstrap
  • app.php
  • providers.php
  • cache…
  • config
  • app.php
  • auth.php
  • cache.php
  • database.php
  • filesystems.php
  • logging.php
  • mail.php
  • queue.php
  • services.php
  • session.php
  • sanctum.phpnew
  • database
  • .gitignore
  • database.sqlite, not committed
  • langnew
  • node_modules…, not committed
  • public
  • .htaccess
  • index.php
  • favicon.ico
  • robots.txt
  • build…, not committed
  • storage…new, not committed
  • resources
  • routes
  • web.php
  • console.php
  • api.phpnew
  • storage
  • framework…
  • tests
  • Pest.php
  • TestCase.php
  • vendor…, not committed
  • .editorconfig
  • .env, not committed
  • .env.example
  • .gitattributes
  • .gitignore
  • artisan
  • boost.json
  • composer.json
  • composer.lock
  • compose.yamlnew
  • package.json
  • package-lock.json
  • phpstan.neonnew
  • phpunit.xml
  • pint.jsonnew
  • README.md
  • vite.config.js
  1. # Install the Laravel installer (needs PHP 8.3 or newer and Composer; php.new installs all three)

    composer global require laravel/installer
  2. # Create the app: choose no starter kit (or React, Vue, Livewire), Pest, and SQLite

    laravel new clinic-app
  3. # Or create it with Composer only (PHPUnit instead of Pest)

    composer create-project laravel/laravel clinic-app
  4. # Run the web server, queue worker, logs and Vite together

    cd clinic-app && composer run dev
  5. # Generate a model with migration, factory, policy and resource controller

    php artisan make:model Appointment -mfp --controller --resource
  6. # Add the API routes and Sanctum tokens when a mobile app needs them

    php artisan install:api
  7. # Add static analysis and browser tests

    composer require --dev larastan/larastan pestphp/pest-plugin-browser
  8. # Add Redis queues with a dashboard for production

    composer require laravel/horizon && php artisan horizon:install