Search code examples
phplaravelqr-codeapiato

How to access an item endpoint without login token in apiato php?


I have been working on invoice system which I need to add each invoice with a QR generated by a system which when we print invoice as hard copy we can just scan the QR and access the preview page of that invoice (id). I am using apiato and every time I access the endpoint I need to login to get auth token. But as for customer they don't need to login to see the preview, just to see the invoice before paying.


Solution

  • Ex: 
    
    Route::get('invoices', [Controller::class, 'getAllInvoices'])
        ->name('')
        ->middleware(['auth:api']);
    
        just delete ->middleware(['auth:api']);
    
        Route::get('invoices', [Controller::class, 'getAllInvoices'])
        ->name('');