sleeping-owl / admin

Administrative interface builder for Laravel
http://sleeping-owl.github.io/
MIT License
503 stars 259 forks source link

Displays broken image #294

Open kmligue opened 8 years ago

kmligue commented 8 years ago

I have this in my model

public function getImageFields()
    {
        return [
            'logo_url' => ['logos/', function($directory, $originalName, $extension) {
                return $originalName;
            }],
        ];
    }

config/admin.php

<?php

return [
    /*
     * Admin title
     * Displays in page title and header
     */
    'title'                 => 'Sleeping Owl administrator',

    /*
     * Admin url prefix
     */
    'prefix'                => 'admin',

    /*
     * Before filters to protect admin from unauthorized users
     */
    'beforeFilters'         => ['admin.auth'],

    /*
     * Path to admin bootstrap files directory in app directory
     * Default: 'app/admin'
     */
    'bootstrapDirectory'    => app_path('admin'),

    /*
     * Path to images directory
     * Default: 'public/images'
     */
    'imagesDirectory'       => public_path('assets/images/companies'),

    /*
     * Path to files directory
     * Default: 'public/files'
     */
    'filesDirectory'        => public_path('files'),

    /*
     * Path to images upload directory within 'imagesDirectory'
     * Default: 'uploads'
     */
    'imagesUploadDirectory' => 'logos',

    /*
     * Authentication config
     */
    'auth'                  => [
        'model'  => '\SleepingOwl\AdminAuth\Entities\Administrator',
        'rules' => [
            'username' => 'required',
            'password' => 'required',
        ]
    ],

    /*
     * Blade template prefix, default admin::
     */
    'bladePrefix'                => 'admin::',
];

config/imagecache.php

<?php

return array(

    /*
    |--------------------------------------------------------------------------
    | Name of route
    |--------------------------------------------------------------------------
    |
    | Enter the routes name to enable dynamic imagecache manipulation.
    | This handle will define the first part of the URI:
    | 
    | {route}/{template}/{filename}
    | 
    | Examples: "images", "img/cache"
    |
    */

    'route' => 'assets/images/companies/logos',

    /*
    |--------------------------------------------------------------------------
    | Storage paths
    |--------------------------------------------------------------------------
    |
    | The following paths will be searched for the image filename, submited 
    | by URI. 
    | 
    | Define as many directories as you like.
    |
    */

    'paths' => array(
        public_path('upload'),
        public_path('images'),
        public_path('assets/images/companies')

    ),

    /*
    |--------------------------------------------------------------------------
    | Manipulation templates
    |--------------------------------------------------------------------------
    |
    | Here you may specify your own manipulation filter templates.
    | The keys of this array will define which templates 
    | are available in the URI:
    |
    | {route}/{template}/{filename}
    |
    | The values of this array will define which filter class
    | will be applied, by its fully qualified name.
    |
    */

    'templates' => array(
        'small' => 'Intervention\Image\Templates\Small',
        'medium' => 'Intervention\Image\Templates\Medium',
        'large' => 'Intervention\Image\Templates\Large',
    ),

    /*
    |--------------------------------------------------------------------------
    | Image Cache Lifetime
    |--------------------------------------------------------------------------
    |
    | Lifetime in minutes of the images handled by the imagecache route.
    |
    */

    'lifetime' => 43200,

);

why is it that i get a broken image? even if i do the default config of this files still i get broken image.