app/Http/Controllers/HomeController.php
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show the application dashboard.
@return \Illuminate\Contracts\Support\Renderable
Show the application dashboard . @return \ Illuminate \ Contracts \ Support \ Renderable
public function index()
    {
        date_default_timezone_set('Asia/Taipei');
        $today = date('Y-m-d');
        $now = date('Y-m-d H:i:s');
        $active_classes = Teacher::where('t_date', '=', $today)->orderBy('t_time')->get();
        $user = auth()->user();
        $books = Teacher::where('student', '=', $user->name)->where('t_date', '>=', $today)->
                        orderBy('t_date')->orderBy('t_time')->get();
        return view('home', compact('now', 'user', 'books', 'active_classes'));
    }
public function index ( ) { date_default_timezone_set ( 'Asia/Taipei' ) ; $ today = date ( 'Y-m-d' ) ; $ now = date ( 'Y-m-d H:i:s' ) ; $ active_classes = Teacher :: where ( 't_date' , '=' , $ today ) -> orderBy ( 't_time' ) -> get ( ) ; $ user = auth ( ) -> user ( ) ; $ books = Teacher :: where ( 'student' , '=' , $ user -> name ) -> where ( 't_date' , '>=' , $ today ) -> orderBy ( 't_date' ) -> orderBy ( 't_time' ) -> get ( ) ; return view ( 'home' , compact ( 'now' , 'user' , 'books' , 'active_classes' ) ) ; }
Show the application dashboard.
Show the application dashboard .