I'm using laravel 5.2.45 and I have the following routes
Route::group([
'namespace' => 'Api',
'prefix' => "api",
'middleware' => 'service'
], function() {
Route::get('student/{msisdn}/status', 'StudentController@status');
});
my middleware is service so here is my config/service.php
<?php
return [
'password' => //password here,
'ip' => //my server ip here,
'url' => [
'check_status' => 'http://%s/student/api/checkUser?password=%s&msisdn=%s',
]
];
This code works fine according to my requirements, but what i want now is to apply basic authentication without database. I just want a hardcorded username and password (its my requirements, otherwise i would use db).
As my middleware is service and how will i apply another middleware basic.auth on it, is it possible to use two middleware ? or combine both service and basic.auth middle ware and create new middleware? any suggestion, tutorial or example code on how can i do that?