app/Http/Controllers/Admin/BusController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        if (Auth::user()->companyProfile->count() == 0)
            return redirect()->route('admin.profile')->withErrors(['error' => 'Provide company profile first']);
        $buses = Auth::user()->company()->buses()->latest()->get();
        $busClasses = Auth::user()->company()->busClasses()->get();
        return view('admin.buses.index', compact('buses', 'busClasses'));
    }
public function index ( ) { if ( Auth :: user ( ) -> companyProfile -> count ( ) == 0 ) return redirect ( ) -> route ( 'admin.profile' ) -> withErrors ( [ 'error' => 'Provide company profile first' ] ) ; $ buses = Auth :: user ( ) -> company ( ) -> buses ( ) -> latest ( ) -> get ( ) ; $ busClasses = Auth :: user ( ) -> company ( ) -> busClasses ( ) -> get ( ) ; return view ( 'admin.buses.index' , compact ( 'buses' , 'busClasses' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//