PHP code example of yarazan / laravel-sanctum-api-only

1. Go to this page and download the library: Download yarazan/laravel-sanctum-api-only 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/ */

    

yarazan / laravel-sanctum-api-only example snippets


   Route::middleware('auth:sanctum')->group(function () {
       // Your protected routes here
   });
   
bash
   php artisan key:generate
   
bash
   php artisan app:generate-root-password
   
bash
   php artisan db:seed