Currently I'm working on a Laravel project and I try to return a view in my controller. So far, so good.
But, when I really want to show the data from the view, nothing gots returned. It only shows a white screen.
So, what can be the problem? I don't know yet.
This is my current code
public function show(Domain $inputDomain)
{
$domainId = Domain::where('domain', $inputDomain->domain)->firstOrFail()->id;
$scanId = Scan::where('domain_id', $domainId)->firstOrFail()->id;
$result = Result::where('scan_id', $scanId)->firstOrFail();
return view('detail');
}
The last return does not work, it does not show the view.
Good to know:
1. When I just dump (dd) true, it works and I see the true-message
2. The view really exists and it contains data (I also tried to replace the blade template with some 'lorem ipsum' data, but also that did'nt show up)
When I just do a dd on the View::render (made an $view
variable and did dd($view->render()
) it shows me the HTML (in the DD screen), but when I return it, it is empty.
Comments
According to a comment I want to show the Route that I'm using
Route::get('{domain}', 'DomainController@scan');
According to a comment, I also want to show that I point to a file in the root of views/
How can I show the view to the visitor?
Also good to know, (forgot to mention) This is my @scan function
public function scan(Domain $domain)
{
Dispatch(new ProcessScan($domain));
$this->show($domain);
}