title: CKFinder custom baseUrl/root for ckfinder / ckfinder-laravel-package for frontend users and admin portal users
body: <p>I am using ckfinder / ckfinder-laravel-package package for one of my project build with Laravel and Vue.js</p>
  <p>So far, CKFinder was used in admin portal but now I need to use this in frontend portal also. But I can't give all the folders access to frontend users. I need to use a specific media folder for frontend users. For that, I need to use different baseUrl and root for the frontend and admin portal. For your kind information all the admin routes are staring with <strong>/admin</strong></p>
  <p>How can I do that?</p>
  <p>Here is my config/ckfinder.php</p>
  <pre><code>&lt;?php
  
  use Illuminate\Support\Str;
  
  session_start();
  /*
   * CKFinder Configuration File
   *
   * For the official documentation visit http://docs.cksource.com/ckfinder3-php/
   */
  
  /*============================ PHP Error Reporting ====================================*/
  // http://docs.cksource.com/ckfinder3-php/debugging.html
  
  // Production
  //error_reporting(E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT);
  //ini_set('display_errors', 0);
  
  // Development
  // error_reporting(E_ALL);
  // ini_set('display_errors', 1);
  
  /*============================ General Settings =======================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html
  
  $config = array();
  
  $config['current_portal'] = 'admin';
  
  $config['authentication'] = '\App\Http\Middleware\CustomCKFinderAuth';
  
  /*============================ License Key ============================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_licenseKey
  
  $config['licenseName'] = '';
  $config['licenseKey']  = '*E?G-*1**-H**3-*J**-*Z**-4*1*-2**G';
  
  /*============================ CKFinder Internal Directory ============================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_privateDir
  
  $config['privateDir'] = array(
      'backend' =&gt; 'laravel_cache',
      'tags'    =&gt; 'ckfinder/tags',
      'cache'   =&gt; 'ckfinder/cache',
      'thumbs'  =&gt; 'ckfinder/cache/thumbs',
      'logs'    =&gt; array(
          'backend' =&gt; 'laravel_logs',
          'path'    =&gt; 'ckfinder/logs'
      )
  );
  
  $config['loadRoutes'] = true;
  /*============================ Images and Thumbnails ==================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_images
  
  $config['images'] = array(
      'maxWidth'  =&gt; 2500,
      'maxHeight' =&gt; 1500,
      'quality'   =&gt; 80,
      'sizes' =&gt; array(
          'small'  =&gt; array('width' =&gt; 480, 'height' =&gt; 320, 'quality' =&gt; 80),
          'medium' =&gt; array('width' =&gt; 600, 'height' =&gt; 480, 'quality' =&gt; 80),
          'large'  =&gt; array('width' =&gt; 800, 'height' =&gt; 600, 'quality' =&gt; 80)
      )
  );
  
  /*=================================== Backends ========================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_backends
  
  // The two backends defined below are internal CKFinder backends for cache and logs.
  // Plase do not change these, unless you really want it.
  $config['backends']['laravel_cache'] = array(
      'name'         =&gt; 'laravel_cache',
      'adapter'      =&gt; 'local',
      'root'         =&gt; storage_path('framework/cache')
  );
  
  $config['backends']['laravel_logs'] = array(
      'name'         =&gt; 'laravel_logs',
      'adapter'      =&gt; 'local',
      'root'         =&gt; storage_path('logs')
  );
  
  // Backends
  
  $config['backends']['default'] = array(
      'name'         =&gt; 'default',
      'adapter'      =&gt; 'local',
      'baseUrl'      =&gt; env('APP_URL').'/media/',
      'root'         =&gt; public_path('media').'/',
      'chmodFiles'   =&gt; 0777,
      'chmodFolders' =&gt; 0755,
      'filesystemEncoding' =&gt; 'UTF-8'
  );
  
  /*================================ Resource Types =====================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_resourceTypes
  
  $config['defaultResourceTypes'] = '';
  
  $config['resourceTypes'][] = array(
      'name'              =&gt; 'Files', // Single quotes not allowed.
      'directory'         =&gt; 'files',
      'maxSize'           =&gt; 0,
      'allowedExtensions' =&gt; '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mkv,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
      'deniedExtensions'  =&gt; '',
      'backend'           =&gt; 'default'
  );
  
  $config['resourceTypes'][] = array(
      'name'              =&gt; 'Images',
      'directory'         =&gt; '',
      'maxSize'           =&gt; 0,
      'allowedExtensions' =&gt; '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mkv,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
      'deniedExtensions'  =&gt; '',
      'backend'           =&gt; 'default'
  );
  
  /*================================ Access Control =====================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_roleSessionVar
  
  $config['roleSessionVar'] = 'CKFinder_UserRole';
  
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_accessControl
  $config['accessControl'][] = array(
      'role'                =&gt; '*',
      'resourceType'        =&gt; '*',
      'folder'              =&gt; '/',
  
      'FOLDER_VIEW'         =&gt; true,
      'FOLDER_CREATE'       =&gt; true,
      'FOLDER_RENAME'       =&gt; true,
      'FOLDER_DELETE'       =&gt; false,
  
      'FILE_VIEW'           =&gt; true,
      'FILE_UPLOAD'         =&gt; true,
      'FILE_RENAME'         =&gt; true,
      'FILE_DELETE'         =&gt; true,
  
      'IMAGE_RESIZE'        =&gt; true,
      'IMAGE_RESIZE_CUSTOM' =&gt; true
  );
  
  
  /*================================ Other Settings =====================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html
  
  $config['overwriteOnUpload'] = false;
  $config['checkDoubleExtension'] = true;
  $config['disallowUnsafeCharacters'] = false;
  $config['secureImageUploads'] = true;
  $config['checkSizeAfterScaling'] = true;
  $config['htmlExtensions'] = array('html', 'htm', 'xml', 'js');
  $config['hideFolders'] = array('.*', 'CVS', '__thumbs');
  $config['hideFiles'] = array('.*');
  $config['forceAscii'] = false;
  $config['xSendfile'] = false;
  
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_debug
  $config['debug'] = true;
  
  /*==================================== Plugins ========================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_plugins
  
  $config['plugins'] = array();
  
  /*================================ Cache settings =====================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_cache
  
  $config['cache'] = array(
      'imagePreview' =&gt; 24 * 3600,
      'thumbnails'   =&gt; 24 * 3600 * 365
  );
  
  /*============================ Temp Directory settings ================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_tempDirectory
  
  $config['tempDirectory'] = sys_get_temp_dir();
  
  /*============================ Session Cause Performance Issues =======================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_sessionWriteClose
  
  $config['sessionWriteClose'] = true;
  
  /*================================= CSRF protection ===================================*/
  // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_csrfProtection
  
  $config['csrfProtection'] = false;
  
  /*============================== End of Configuration =================================*/
  
  /**
   * Config must be returned - do not change it.
   */
   
  return $config;
  </code></pre>
  <p>Thanks in advance!</p>