PHP code example of florddev / laravel-auto-routing
1. Go to this page and download the library: Download florddev/laravel-auto-routing library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
florddev / laravel-auto-routing example snippets
'providers' => [
// Other service providers...
Florddev\LaravelAutoRouting\AutoRoutingServiceProvider::class,
],
use Florddev\LaravelAutoRouting\Attributes\HttpGet;
use Florddev\LaravelAutoRouting\Attributes\HttpPost;
use Florddev\LaravelAutoRouting\Attributes\HttpPut;
use Florddev\LaravelAutoRouting\Attributes\HttpDelete;
class UserController extends Controller
{
#[HttpGet]
public function index() { /* ... */ }
#[HttpGet]
public function show(int $id) { /* ... */ }
#[HttpPost]
public function store() { /* ... */ }
#[HttpPut]
public function update(int $id) { /* ... */ }
#[HttpDelete]
public function destroy(int $id) { /* ... */ }
}