Skip to content

Latest commit

 

History

History
182 lines (114 loc) · 7.02 KB

DOCS.md

File metadata and controls

182 lines (114 loc) · 7.02 KB

Laravel Ready Dev Docs

📦 Preinstalled laravel packages

  • pretty-routes: List all routes in one UI.

    • Navigate to /routes in your browser.
  • LogViewer: View Laravel logs in one UI.

    • Navigate to /logs in your browser.
  • laravel-data: Powerful data objects for Laravel.

  • spatie/laravel-ignition: Better error page layout. (packageist: binarytorch/larecipe)

  • saleem-hadad/larecipe: Write documentation via Markdown inside your Laravel App.

    • First, you must run php artisan larecipe:install command to publish the needed assets and configurations.
    • Then, Navigate to /docs in your browser.
  • laravel/ui: Ready to use auth views, forms, UI utilities and presets.

    • Views and controllers are already installed but you can overwrite with run php artisan ui:auth command to publish the needed assets and configurations.
  • Debugging

    • clockwork: Modern debugging tool for Laravel. (debugbar alternative)

      • Navigate to /clockwork in your browser.
    • debugbar: In UI, see app metrics and logs.

    • laravel-ray: Debug with Ray to fix problems faster in Laravel apps. It requires ray app (paid app).

  • Support

    • readable-numbers: Human readable numbers.
    • ultimate-support: Useful helper collection.
    • hasin: The 'hasin' is 'Relation Mixin' of 'Laravel ORM'. Replacement for some has and whereHas cases.
    • once: A magic memoization function to cache the result of a function call.
  • Code Analysis

    • larastan: Adds code analysis to Laravel improving developer productivity and code quality (PHPStan wrapper).
    • pint: PHP code style fixer (PHP-CS Fixer wrapper).
    • pest: Pest is an elegant PHP Testing Framework with a focus on simplicity.

🚩 Languages

  • en: native/default
  • tr

Preinstalled packages

⚡ ViteJS

Also this project uses ViteJS to speed up the development process. You can use it to build your project faster.

Why we are using both of them?

ViteJS is a JavaScript runtime that is optimized for web applications. For example, it is optimized for the Vue.js framework. But if you want to use blade templates, Laravel Mix is still a useful option.

🎨 Artisan Commands

Click to see artisan commands

Serve app

pas

# or

php artisan serve

Create necessary files and model

# create migrataion, factory, seeder, model, policy, controller, request at once
php artisan make:model Language/Language -msa

# create filamet resources at once
php artisan make:filament-resource Language/Language --generate

# seed the database
php artisan db:seed
# composer autoload optimization

composer dump-autoload -o

Larastan Commands

To ignore specific lines of code, add the following comments to your code.

Click to see larastan commands
# analyze code

php ./vendor/bin/phpstan analyse --memory-limit=2G --level=9

✂️ Pint Commands

See full config list and examples here.

Click to see pint commands
# check and fix code style

php ./vendor/bin/pint -v

🔬 Pest Commands

See more examples abouts pesting here.

Click to see pest commands
# run tests

php ./vendor/bin/pest

⚠️ Commit Messages

Otherwise, I won't be able to review your commits.

🐳 Docker

This project comes with a docker stack for laravel. It contains: serversideup/php image for Laravel app, MySQL, and Redis containers.

docker-compose.yml use .env file for configurations. So, you need to rename .env-example to .env and fill it with your own credentials. Then you can run docker-compose up -d to start the stack.

🔄 Run Github Actions on Your Local

You can run github actions workflow on your local environment with Act app for basic scenarios.

Warning

Act is using catthehacker/ubuntu images and ubuntu-latest image is around ~20GB (after extraction is will be ~60GB). First installation may take long time. To see all image variations check available tags. To avoid this use lighter images, like js-latest.

Run this command and watch local action steps in your terminals:

# run all
act -P ubuntu-latest=catthehacker/ubuntu:js-latest  --verbose 

# run specific workflow
act -P ubuntu-latest=catthehacker/ubuntu:js-latest -W '.github/workflows/preflight.yml' --verbose

Also, you can manage some configs with .actrc file.

When we pushed our repository github will handle with original ubuntu-latest image (also, see limitations).

👍 Suggested VS Code Plugins and Tools

Plugins

  • EditorConfig: syncs our editor configs, required for .editorconfig file.
  • Prettier: common formatter plugin, required for .prettierrc file.
  • Terminals Manager: a terminal manager that automatically launches terminals, required for .vscode\terminals.json.
  • Peacock: custom theme manager for multiple projects, required for .vscode\settings.json.
  • Docker: a minimal docker manager, required for backend and full-stack developers.

Tools