alexusmai / laravel-file-manager

File manager for Laravel
MIT License
1.14k stars 292 forks source link

Not Found Error #45

Closed nkuldip closed 5 years ago

nkuldip commented 5 years ago

Configured properly but show error not found, see bellow secreenshot image

Also display file-manager/initialize on inspect element image

Please help me. what's wrong here?

alexusmai commented 5 years ago

Show your configuration files - filesystems.php and file-manager.php

nkuldip commented 5 years ago

Here is code file-manager.php `<?php

return [

/**
 * list of disk names that you want to use
 * (from config/filesystems)
 */
'diskList'  => ['images', 'public'],

/**
 * Default disk for left manager
 * null - auto select the first disk in the disk list
 */
'leftDisk'  => null,

/**
 * Default disk for right manager
 * null - auto select the first disk in the disk list
 */
'rightDisk' => null,

/**
 * Default path for left manager
 * null - root directory
 */
'leftPath'  => null,

/**
 * Default path for right manager
 * null - root directory
 */
'rightPath' => null,

/**
 * Image cache ( Intervention Image Cache )
 * set null, 0 - if you don't need cache (default)
 * if you want use cache - set the number of minutes for which the value should be cached
 */
'cache' => null,

/**
 * File manager modules configuration
 * 1 - only one file manager window
 * 2 - one file manager window with directories tree module
 * 3 - two file manager windows
 */
'windowsConfig' => 2,

/***************************************************************************
 * Middleware
 * Add your middleware name to array -> ['web', 'auth', 'admin']
 * !!!! RESTRICT ACCESS FOR NON ADMIN USERS !!!!
 *
 * !!! For using ACL - add 'fm-acl' to array !!! ['web', 'fm-acl']
 */
'middleware' => ['web', 'fm-acl'],

/***************************************************************************
 * ACL mechanism ON/OFF
 *
 * default - false(OFF)
 */
'acl' => true,

/**
 * Hide files and folders from file-manager if user doesn't have access
 * ACL access level = 0
 */
'aclHideFromFM' => true,

/**
 * ACL strategy
 *
 * blacklist - Allow everything(access - 2 - r/w) that is not forbidden by the ACL rules list
 *
 * whitelist - Deny anything(access - 0 - deny), that not allowed by the ACL rules list
 */
'aclStrategy'   => 'blacklist',

/**
 * ACL rules repository
 *
 * default - config file(ConfigACLRepository)
 */
'aclRepository' => Alexusmai\LaravelFileManager\Services\ACLService\ConfigACLRepository::class,
//'aclRepository' => Alexusmai\LaravelFileManager\Services\ACLService\DBACLRepository::class,

/**
 * ACL rules list - used for default repository
 *
 * 1 it's user ID
 * null - for not authenticated user
 *
 * 'disk' => 'disk-name'
 *
 * 'path' => 'folder-name'
 * 'path' => 'folder1*' - select folder1, folder12, folder1/sub-folder, ...
 * 'path' => 'folder2/*' - select folder2/sub-folder,... but not select folder2 !!!
 * 'path' => 'folder-name/file-name.jpg'
 * 'path' => 'folder-name/*.jpg'
 *
 * * - wildcard
 *
 * access: 0 - deny, 1 - read, 2 - read/write
 */
'aclRules'      => [
    null => [
        //['disk' => 'public', 'path' => '/', 'access' => 2],
    ],
    1 => [
        //['disk' => 'public', 'path' => 'images/arch*.jpg', 'access' => 2],
        //['disk' => 'public', 'path' => 'files/*', 'access' => 1],
    ],
],

/**
 * ACL Rules cache
 *
 * null or value in minutes
 */
'aclRulesCache' => null,

]; ?> **filesystems.php** <?php

return [

// Filesystem Disks 'disks' => [ // images folder in public path 'images' => [ 'driver' => 'local', 'root' => public_path('images'), 'url' => env('APP_URL').'/images/', ],

// public folder in storage/app/public
'public' => [
    'driver' => 'local',
    'root' => storage_path('app/public'),
    'url' => env('APP_URL').'/storage', // https://laravel.com/docs/5.7/filesystem#file-urls
    'visibility' => 'public',
],

// ftp
'dd-wrt' => [
    'driver'   => 'ftp',
    'host'     => 'ftp.dd-wrt.com',
    'username' => 'anonymous',
    'passive'  => true,
    'timeout'  => 30,
],

], ];?> `

alexusmai commented 5 years ago

It's strange.. Try - composer dump-autoload

Execute command - php artisan route:list You should have this line:

 GET|HEAD | file-manager/initialize       | fm.initialize       | Alexusmai\LaravelFileManager\Controllers\FileManagerController@initialize      | web,fm-acl

also on request - http://site-name.com/file-manager/initialize - it is possible directly in the browser - the answer should come in the form of a string with a config, if not... you have a problem with your laravel/server configuaration

nkuldip commented 5 years ago

No any laravel/server configuaration issue,other script are working fine in local. I am using laravel 5.8 so it's supported or not? I try this url in local but not working, image

alexusmai commented 5 years ago

The problem in the your URL http://localhost/laravel58/public - public- it should be a root folder, and URL should be like this - http://localhost

See laravel docs

After installing Laravel, you should configure your web server's document / web root to be the public directory. The  index.php in this directory serves as the front controller for all HTTP requests entering your application.
prappo commented 5 years ago

Where I can change the root URL ?

Davixe7 commented 3 years ago

Solved the same issue reinstalling the package after upgrading to Laravel 8