PHP code example of coreproc / laravel-devices

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 [];
});
bash
php artisan vendor:publish --provider="Coreproc\Devices\DevicesServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Coreproc\Devices\DevicesServiceProvider" --tag="config"