Heres your error "preg_replace(): Parameter mismatch, pattern is a string while replacement is an array"
You're passing an array into preg_replace() when it expects 2 strings or 2 arrays, not a mixture.
Then how would I go about changing it. I've tried everything that I know and none of them seemed to work.
You'll need to check your log files and follow the trace stack to see what you're calling is causing that problem. The json error doesn't provide enough information as to where the error came from.
I've checked the logs and the last error that i got was
[19-Nov-2014 09:41:52 UTC] PHP Fatal error: Class 'Admin\Input' not found in /Applications/MAMP/htdocs/laravel/app/controllers/admin/GroupsController.php on line 61
and on that line falls in
public function store()
{
if(!empty($_POST) && \Request::ajax())
{
$group = new \Groups();
$input = \Input::all();
$validation = \Validator::make($input, \Groups::$rules);
if($validation->fails()){
$groupList = \Groups::all();
$html = \View::make('admin.usersPermissions.partials.get-groups-list', compact("groupList"))->render();
return \Response::json(array('html' => $html, 'id' => $group->id, 'message' => 'Group unsuccessfully saved.'));
}
if($validation->passes()){
$ignore = array('_token');
foreach($_POST as $key => $value){
if(!in_array($key, $ignore))
$group->{$key} = $value;
} //THIS IS LINE 61
$resource_id = $group->resources()->sync(\Input::get("resource_id", []));
$group->save();
$resources = \Resource::where("secure", true)->get();
$groupList = \Groups::all();
$html = \View::make('admin.usersPermissions.partials.get-groups-list', compact('groupList', 'resources'))->render();
return \Response::json(array('html' => $html, 'id' => $group->id, 'message' => 'Group successfully saved.'));
}
}
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community