That's my relevant route:
Route::get('user/{username}/edit', [
'as' => 'user.edit',
'uses' => "UsersController@edit"
]);
and the function:
public function edit($username)
{
$user = User::where('username', '=', $username)->first();
// dd($user);
return View::make('user.edit' . ['user' => $user]);
}
So, in another view I click a button which has the following code:
{{ link_to('user/'.$user->username.'/edit', 'Edit', ['class' => 'btn btn-default']) }}
and it leads me to the correct URL, but throws Array to string conversion
exception for this line: return View::make('user.edit' . ['user' => $user]);
from the show method. Where I dump the object, right before this line of code, it is correct, populated with values.
It is strange, because I have another method that has the exactly same implementation, but just returns to another view, and it works fine.
Any ideas why am I getting this error?