Skip to content

ErrorException (E_NOTICE) when user with master role request /home #208

@stardigits

Description

@stardigits

Describe the bug
ErrorException (E_NOTICE) happen when user with master role request /home

To Reproduce
Steps to reproduce the behavior:

  1. Login as master
  2. Request using url /home

Expected behavior
It should redirect to /masters (master homepage)

Screenshots
ErrorException (E_NOTICE)
Trying to get property 'id' of non-object

\app\Http\Controllers\HomeController.php
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}

/**
 * Show the application dashboard.
 *
 * @return \Illuminate\Http\Response
 */
public function index()
{
    $minutes = 1440;// 24 hours = 1440 minutes
    $school_id = \Auth::user()->school->id;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions