xqsit94/laravel-webservice-example-boilerplate

Laravel webservice example/boilerplate using laravel 7.x, Sanctum and Facades pattern. Clone and add your own functionalities


README

68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6474666276766b79702f696d6167652f75706c6f61642f76313536363333313337372f6c61726176656c2d6c6f676f6c6f636b75702d636d796b2d7265642e737667

Laravel Webservice Example/Boilerplate

Usage

This is not a package - it's a full Laravel project that you should use as a starter boilerplate, and then add your own custom functionalities.

  • Clone the repository with git clone
  • Copy .env.example file to .env and edit database credentials there
  • Run composer install
  • Run php artisan key:generate
  • Run php artisan migrate
  • That's it: Test API's with Postman

Useful snippets to check

  • HasApiResponse Trait
  • render method in Handler.php
  • Facades keyword in controllers (Used as proxies for calling non-static method static)
  • Facades folder

** Note: Every api should hold Accept: Application/json in header. **