FrozenNode / Laravel-Administrator

An administrative interface package for Laravel
http://administrator.frozennode.com/
MIT License
1.94k stars 504 forks source link

Trying to change the value of uri in administartor.php returns InvalidArgumentException in UrlGenerator.php line 307: Route [admin_dashboard] not defined. #1055

Closed vintots closed 7 years ago

vintots commented 7 years ago

this is my administrator.php

`<?php

// use App\Http\Controllers\URL; // use URL; // use Redirect;

return array(

/**
 * Package URI
 *
 * @type string
 */
// 'uri' => 'myadmin',
'uri' => 'system',

/**
 *  Domain for routing.
 *
 *  @type string
 */
'domain' => '',

/**
 *  Middleware for admin routing.
 *
 *  @type array
 */
'middleware' => array('web'),

/**
 * Page title
 *
 * @type string
 */
'title' => 'Admin',

/**
 * The path to your model config directory
 *
 * @type string
 */
'model_config_path' => config_path('administrator'),

/**
 * The path to your settings config directory
 *
 * @type string
 */
'settings_config_path' => config_path('administrator/settings'),

/**
 * The menu structure of the site. For models, you should either supply the name of a model config file or an array of names of model config
 * files. The same applies to settings config files, except you must prepend 'settings.' to the settings config file name. You can also add
 * custom pages by prepending a view path with 'page.'. By providing an array of names, you can group certain models or settings pages
 * together. Each name needs to either have a config file in your model config path, settings config path with the same name, or a path to a
 * fully-qualified Laravel view. So 'users' would require a 'users.php' file in your model config path, 'settings.site' would require a
 * 'site.php' file in your settings config path, and 'page.foo.test' would require a 'test.php' or 'test.blade.php' file in a 'foo' directory
 * inside your view directory.
 *
 * @type array
 *
 *  array(
 *      'E-Commerce' => array('collections', 'products', 'product_images', 'orders'),
 *      'homepage_sliders',
 *      'users',
 *      'roles',
 *      'colors',
 *      'Settings' => array('settings.site', 'settings.ecommerce', 'settings.social'),
 *      'Analytics' => array('E-Commerce' => 'page.ecommerce.analytics'),
 *  )
 */
'menu' => array(
    'menu1',
    'menu2',
    // 'subscribers',
    'menu3',
    'menu4',
    // 'songs' =>       'page.administrator.song',
    // 'Link Title' => URL::route('/admin/song')
),

/**
 * The permission option is the highest-level authentication check that lets you define a closure that should return true if the current user
 * is allowed to view the admin section. Any "falsey" response will send the user back to the 'login_path' defined below.
 *
 * @type closure
 */
'permission'=> function()
{
    // Auth::loginUsingId(7);
    return Auth::check();
    // print_r('this is a test');
    // print_r(Auth::user());
    // print_r('Auth::check()');
    // die();
    // return false;
},

/**
 * This determines if you will have a dashboard (whose view you provide in the dashboard_view option) or a non-dashboard home
 * page (whose menu item you provide in the home_page option)
 *
 * @type bool
 */
'use_dashboard' => false,

/**
 * If you want to create a dashboard view, provide the view string here.
 *
 * @type string
 */
'dashboard_view' => '',

/**
 * The menu item that should be used as the default landing page of the administrative section
 *
 * @type string
 */
'home_page' => 'users',

/**
 * The route to which the user will be taken when they click the "back to site" button
 *
 * @type string
 */
'back_to_site_path' => 'system',

/**
 * The login path is the path where Administrator will send the user if they fail a permission check
 *
 * @type string
 */
'login_path' => 'system',//URL::route('admin/login') ,

/**
 * The logout path is the path where Administrator will send the user when they click the logout link
 *
 * @type string
 */
'logout_path' => 'system',//URL::route('login'),,

/**
 * This is the key of the return path that is sent with the redirection to your login_action. Session::get('redirect') will hold the return URL.
 *
 * @type string
 */
'login_redirect_key' => 'redirect',//Redirect::to(Session::get('admin/users')),//'redirect',

/**
 * Global default rows per page
 *
 * @type int
 */
'global_rows_per_page' => 20,

/**
 * An array of available locale strings. This determines which locales are available in the languages menu at the top right of the Administrator
 * interface.
 *
 * @type array
 */
'locales' => array(),

// View::prependNamespace('administrator', '/administrator'),

);

// View::composer(array('administrator::layouts.default'), function($view) // { // die(print_r('test')); // //first check if this is a custom page // if ($view->page === 'ecommerce.analytics') // { // //add page-specific assets // $view->js += array( // 'highcharts' => '/path/to/highcharts.js' // ); // // $view->css += array( // 'mycss' => '/path/to/my.css' // ); // } // });

`

when i change the uri into this 'uri' => 'myadmin' The project is working, how can i fix this error i want to change the uri into 'uri' => 'system' or 'uri' => 'admin'

vintots commented 7 years ago

I will closed this issue i figured out that the cause of my error is my routes is conflicting to the route in the frozen node uri