This guide provides step-by-step instructions for implementing OAuth 2.0 authentication on the getFuelLevies API endpoint using Laravel Passport, which is already configured in your project.
config/auth.php line 45)AuthServiceProvider.phpAdd a new scope for fuel levy access:
// File: app/Providers/AuthServiceProvider.phpPassport::tokensCan([
//define the client scopes 'consignment.read' => "Retrieve a list of your Consignments", 'consignment.write' => "Create or Update a Consignment", 'consignment.status' => "Check a Consignment's status", 'consignment.upload' => "Upload a file related to a Consignment", 'fuel-levy.read' => "Retrieve fuel levy information" // ADD THIS LINE]);
Modify the route in routes/api/tms.php at line 1288:
Current:
Route::get('getFuelLevies','FuelLevyController@getFuelLevies');