FrozenNode / Laravel-Administrator

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

There are problems with your administrator.php config: validation.required ( After installation ) #804

Closed cmarfil closed 9 years ago

cmarfil commented 9 years ago

Hello,

After installation i get:

There are problems with your administrator.php config: validation.required

Assets and config are published.

I have the directories settings created: image

I tried to comment the lines 104 - 107 in: /vendor/frozennode/administrator/src/Frozennode/Administrator/Config/Factory.php

And I get another error:

Administrator: You must provide a valid menu item in the home_page option of your config

My config file "app/config/packages/frozennode/administrator/administrator.php":

<?php

return array(

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

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

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

    /**
     * The path to your settings config directory
     *
     * @type string
     */
    'settings_config_path' => app('path') . '/config/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(),

    /**
     * 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()
    {
        return Auth::check();
    },

    /**
     * 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' => '',

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

    /**
     * The login path is the path where Administrator will send the user if they fail a permission check
     *
     * @type string
     */
    'login_path' => 'user/login',

    /**
     * The logout path is the path where Administrator will send the user when they click the logout link
     *
     * @type string
     */
    'logout_path' => false,

    /**
     * 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',

    /**
     * Global default rows per page
     *
     * @type NULL|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(),

);

Thanks.

Edited: With lines 104 - 107 disableds in: /vendor/frozennode/administrator/src/Frozennode/Administrator/Config/Factory.php And with model entities configured all is working fine. (apparently)

frzsombor commented 9 years ago

Well, _"You must provide a valid menu item in the homepage option of your config" means you must provide a valid menu item in the home_page option of your config, which you actually haven't provided in your config around line 87. Also you haven't added any item to the menu array which is also required and could be the reason of the first error message.

I suggest you to read at least the "Getting Started" section in the documentation (especially the configuration page)

You can also take a look at a sample configuration in the examples folder.

cmarfil commented 9 years ago

Yes, you're right, the problem is that the first error is not descriptive and page setup documentation does not specify that you must have configured a model. Thank You.

frzsombor commented 9 years ago

Yes, the first error message is definitely strange. I think there were some modifications lately, affecting the error messages (the custom error messages) and maybe something went wrong. I will take a look into this if I have some time, thank you for reporting!