1. Go to this page and download the library: Download coreproc/laravel-devices 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/ */
coreproc / laravel-devices example snippets
// routes/api.php
Route::middleware('store.device')->get('/test', function (Request $request) {
return [];
});
// routes/api.php
Route::middleware('store.device:web')->get('/test', function (Request $request) {
return [];
});
// routes/api.php
Route::middleware('store.device:web,0')->get('/test', function (Request $request) {
return [];
});