PHP code example of saeedpooyanfar / laravel-annotation

1. Go to this page and download the library: Download saeedpooyanfar/laravel-annotation 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/ */

    

saeedpooyanfar / laravel-annotation example snippets




use LaravelAnnotation\Attribute\Middleware;

#[Middleware(RedirectIfAuthenticated::class, 'sanctum', except: 'logout')]
class AuthController extends Controller
{
    public function register()
    {
    }
    
    public function login()
    {
    }
    
    #[Middleware(Authenticate::class, 'sanctum')]
    public function logout()
    {
    }
}