PHP code example of torkashvand / laravel-minidevicedetector

1. Go to this page and download the library: Download torkashvand/laravel-minidevicedetector 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/ */

    

torkashvand / laravel-minidevicedetector example snippets


Route::get('/need-destination', [
   'middleware'=> 'mini-detector:viewNeedDestination',
   'uses' => 'NeedDestinationController@index',
]);

Route::group(['prefix' => 'admin', 'middleware' => 'mini-detector:viewAdmin'], function() {

   //all the controllers of your admin section
   ...
   
});

// config/app.php
'providers' => [
    ...
    Torkashvand\MiniDeviceDetector\MiniDeviceDetectorServiceProvider::class,
];

//app/Http/Kernel.php
protected $routeMiddleware = [
  ...
  'mini-detector' => \Torkashvand\MiniDeviceDetector\Middleware\MiniDeviceDetector::class,
];


Route::get('/need-destination', ['middleware'=> 'mini-detector','uses' => 'NeedToDetectController@show']);