1. Go to this page and download the library: Download netmex/laravel-attributes 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/ */
use Netmex\Laravel\Attributes\Route;
final class PostController
{
#[Route(path: '/posts', name: 'posts.index', methods: ['GET'])]
public function index()
{
// controller action
}
#[Route(path: '/posts/{id}', name: 'posts.show', methods: ['GET'],
use Netmex\Laravel\Attributes\Route;
#[Route(path: '/admin', name: 'admin.', middleware: ['auth'])]
final class Admin\DashboardController
{
#[Route(path: '/dashboard', name: 'dashboard')]
public function index() {}
}
bash
php artisan attributes-route:clear
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.