Support the ongoing development of Laravel.io →
Input Database Forms
Last updated 1 year ago.
0

help please

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

Then how would I go about changing it. I've tried everything that I know and none of them seemed to work.

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

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.'));
			}
		}
	}
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

shiva shiva Joined 24 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.