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

Which property is undefined?

0

Well, according to the error message it is my Route. But I have defined my routes correctly:

Route::get('/import', 'DashboardController@getImport');
Route::post('/import', 'DashboardController@postImport');

If I just do this, it will work:

public function postImport(ImportRequest $request)
	{
		return 'Success!';
	}

But when I try to acces "$request", I get the error:

public function postImport(ImportRequest $request)
	{
		$file = $this -> $request -> file('import_file'); # Error 
		return $file;
	}
0

No idea anybody? :S

0

Okay, it was simple:

public function postImport(ImportRequest $request)
{
    $file = $this -> $request -> file('import_file'); # BULLSHIT! -> ERROR!
    $file = $request -> file('import_file'); # WORKS!
    return $file;
}

I hate such simple mistakes ^^

0

Sign in to participate in this thread!

Eventy

Your banner here too?

LukasMa lukasma Joined 26 Nov 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.