to make things simple and for the sake of readability, i would refactor your code like this
public function returnView($data = []){
return view('profile', array_merge([
'csspath' => $this->css,
'lastname' => $this->last_name
...
...
], $data));
}
protected function newAddressBook(Request $request)
{
return $this->returnView([
'extra_data' => 'this is extra data '
]);
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community