I have store method in user controller like this
public function store(Request $request)
{
User::create($request->all());
}
and in another controller I want use this method
public function test(Request $request)
{
.....
app('\App\Http\Controllers\UserController')->store($test_array);
...
}
and $test_array is:
{"name":"test","email":"[email protected]"}
and finally show me error this
Argument 1 passed to App\Http\Controllers\UserController::store() must be an instance of Illuminate\Http\Request,
How can I convert array to Request object?
$requestarray beforeapp('\App\Http\Controllers\UserController')->store($request);?testin the first place? You would be better off usingsetUpor a data provider