I can't find an exact answer to this on Google. I created a Simple Blog Application in Laravel. and used react for front-end and back-end. For crud operation i use resource and api routes.
This is My api.php
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::resource('blog', 'BlogController');
For back-end and front-end same route is used. Now i want to add Authentication for back-end (Admin) and stucked at what to use for authnetication :
I have two options:
I don't understand when to use Token Based Auth or built in auth. In future mobile app is also used for add blog. help me.
Comments
Post a Comment