Trying to get property of non-object (show.blade.php)
<p>I have this problem in my routes where in I get this error tying to get property of non-object view <strong>(show.blade.php)</strong> on clicking a link to view/redirect <strong>allstats.blade.php</strong>. It is very weird because I am not returning my routes to show.blade.php but to allstats.blade.php. I was wondering if I am doing something wrong with the routes. This is very tricky, I don't know what's causing this error.  </p>

<p>@Controller:</p>

<p><strong>EmployeeController.php</strong></p>

<pre><code>    public function postdisplaySummaryReport()
{
    $employeesquery = Employee::paginate(10);

    return View::make('employees.allstats')
    -&gt;with('employeequerytoallstat', $employeesquery);
}
</code></pre>

<p>@Routes:</p>

<p><strong>routes.php</strong></p>

<pre><code>Route::post('employees/sumarryReports','EmployeeController@postdisplaySummaryReport');
Route::resource('employees', 'EmployeeController'); 
</code></pre>

<p>@<strong>index.php</strong>(URL to the allstat.blade.php):</p>

<pre><code>&lt;a href="{{ URL::to('employees/sumarryReports') }}"&gt;&lt;span class="glyphicon glyphicon-folder-open"&gt;&lt;/span&gt; {{trans('labels.payroll_reports.lbl_summary_report')}}&lt;/a&gt;
</code></pre>

<p>@ERROR:
<a href="https://i.stack.imgur.com/kqtsY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kqtsY.png" alt="enter image description here"></a></p>