@JDKOLASSA I think you need to redirect a user to a url, not to return a view.
So try to redirect a user to a certain url that returns a certain view.
So I have a model that is mostly just fields of strings, to be put into the program's main function when used. The last field is an image, that will be added to the final product. I saw the Laracast on Super Simple File Uploading in Laravel 5.3, and thought, "Genius!" But when I tried it, the end result only gave me the first two fields, with everything else blank. So I'm trying to figure out where I'm going wrong.
I'm using the file upload code in my store() method:
public function store(Request $request, Profile $profile)
{
$new = $request->all();
request()->file('logo')->store('logos');
Profile::create($new);
// dd($request, $profile); // Solely using this for testing when appropriate
return view('profiles.index')->with('profiles', $profile);
}
I actually commented out the second line and tried it, and got the same result. I also made the request on the second line $request, but that got me a "Function name must be a string" error. So I'm not sure where the issue is. Should I create a separate controller instead, and use that to manage logos by attaching them to profiles? (I did scaffold that out just in case, but if I don't have to use it I won't as I think that builds in to much complexity.)
Not sure what else I should put here; I'm using a resource controller for Profiles [so Route::resource('profiles', 'ProfilesController');], could that be doing something?
Let me know what else you need.
ok, so check the casing of your attributes
titleTarget in the request != titletargetin the model
etc,etc
Please or to participate in this conversation.