laravel-boilerplate

A Laravel Boilerplate with Batteries on Modern Technologies

APACHE-2.0 License

Stars
5

Laravel Boilerplate

[!NOTE] It must:

  • be on the latest version of Laravel
  • be lightweight to run with Docker
  • use modern technologies such as PHP 8.3, Go 1.23, Python 3.12, etc.

Requirements

Usage

# Build dev image
task build

# Copy Laravel environment variables file
cp -n dev-frontend.env apps/frontend/.env

# Up containers
task up

# Install dependencies, generate key, run migrations
task install

# Show logs
task logs

# Run queue worker
task queue

# Enter the apps container
task console

# Down containers
task down

Commands

Install asset deps:

task bun-install

Build assets:

task bun-dev
task bun-prod

Update locales:

task lang-update

Apply fixes by phpcs:

task phpcs-fix

Analyse the code by Larastan:

task phpstan

Other useful commands:

task check-security

task lint-dockerfile

task validate-and-format-caddyfile

How to update components

  • In docker-compose.yml check new versions of images
  • In Dockerfile check new version of php image
    • Check a new version of php-zmq, phpredis
    • Check a new version of Caddy
  • In the apps container run composer update / composer outdated to check new versions
  • In the apps/frontend folder run:
docker run --rm -v .:/code -it node:20-alpine sh

$ npm -g install npm-check-updates
$ npm-check-updates --format group -i

Misc

  • Access http://localhost/?SPX_KEY=dev&SPX_UI_URI=/ to enable PHP-SPX and see the profiling results;
  • Use dive to analyze Docker images;
  • Use grype to check security vulnerabilities.
Related Projects