sleeping-owl / admin

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

Getting error while dealing with images #333

Open hassansaqib opened 8 years ago

hassansaqib commented 8 years ago

Hi, I am getting the following error.

FatalErrorException in FormBuilder.php line 282: Call to a member function exists() on string

Can you guide me how to resolve it?

My code is as follows:

<?php

Admin::model(\App\IndexImage::class)->title('Index Images')->filters(function () {

})->columns(function () { Column::string('id', 'ID'); Column::string('title', 'Title'); })->form(function () { FormItem::text('title', 'Title'); FormItem::textarea('discription', 'Description'); FormItem::image('path', 'Image'); });

where path is the full address including the name of image relative to the public folder. i.e. "images\index2.png".

strotmann commented 8 years ago

I think you got error here -> FormItem::image('path', 'Image'); must be - > FormItem::image('image', 'Image');