I use stapler since yesterday, I read the installation manual and everything worked like a charm. Except that today, it's not working, no idea why. I removed almost all the code I added since yesterday but no change.
There is no error, nothing in logs, everything seems to work well but the file is not present in my system folder. Everything is OK in the database, config is default (I tried to generate the config and change defaults folder but without any luck.)
No permission complain, tried with 777, no changes.
chown almost everything to _www:staff in my laravel project (running osx maverick)
check all storage/logs/ files
check apache logs file
check system logs file
Note : I use andrew13/Laravel-4-Bootstrap-Starter-Site, I'm new to Laravel since yesterday, but not new to frameworks (silex, symfony, ror).
Edit2 : code
City Model
class City extends Eloquent {
use Codesleeve\Stapler\Stapler;
public function __construct(array $attributes = array()) {
$this->hasAttachedFile('cover', [
'styles' => [
'large' => '1170x160',
'medium' => '970x133',
'small' => '750x103'
]
]);
parent::__construct($attributes);
}
Cities Controller
public function postCreate()
{
// Declare the rules for the form validation
$rules = array(
'title' => 'required|min:3',
);
// Validate the inputs
$validator = Validator::make(Input::all(), $rules);
// Check if the form validates with success
if ($validator->passes())
{
// Update the city data
$this->city->title = Input::get('title');
$this->city->slug = Str::slug(Input::get('title'));
$this->city->meta_title = Input::get('meta-title');
$this->city->meta_description = Input::get('meta-description');
$this->city->meta_keywords = Input::get('meta-keywords');
$this->city->cover = Input::file('cover');
$this->city->opened = Input::get('opened');
$this->city->activated = Input::get('activated');
// Was the city created?
if($this->city->save())
{
// Redirect to the new city page
return Redirect::to('admin/cities')->with('success', Lang::get('admin/cities/messages.create.success'));
}
// Redirect to the city create page
return Redirect::to('admin/cities/create')->with('error', Lang::get('admin/cities/messages.create.error'));
}
// Form validation failed
return Redirect::to('admin/cities/create')->withInput()->withErrors($validator);
}
New test, adding avatar to my user table... everything work like a charm. City still doesn't work, I don't know why, is there any config stored in some place for each model ?
Hi,
I use stapler since yesterday, I read the installation manual and everything worked like a charm. Except that today, it's not working, no idea why. I removed almost all the code I added since yesterday but no change.
There is no error, nothing in logs, everything seems to work well but the file is not present in my system folder. Everything is OK in the database, config is default (I tried to generate the config and change defaults folder but without any luck.)
No permission complain, tried with 777, no changes.
I really don't understand what's wrong...
Any idea ?
Edit :
Already tried :
Note : I use andrew13/Laravel-4-Bootstrap-Starter-Site, I'm new to Laravel since yesterday, but not new to frameworks (silex, symfony, ror).
Edit2 : code
City Model
Cities Controller
View
Edit : last one...
New test, adding avatar to my user table... everything work like a charm. City still doesn't work, I don't know why, is there any config stored in some place for each model ?