app/Http/Controllers/Admin/TerminalController.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']);
        $terminals = Auth::user()->company()->terminals()->latest()->paginate(5);
        return view('admin.terminals.index',compact('terminals'))
            ->with('i', (request()->input('page', 1) - 1) * 5);
    }
public function index ( ) { if ( Auth :: user ( ) -> companyProfile -> count ( ) == 0 ) return redirect ( ) -> route ( 'admin.profile' ) -> withErrors ( [ 'error' => 'Provide company profile first' ] ) ; $ terminals = Auth :: user ( ) -> company ( ) -> terminals ( ) -> latest ( ) -> paginate ( 5 ) ; return view ( 'admin.terminals.index' , compact ( 'terminals' ) ) -> with ( 'i' , ( request ( ) -> input ( 'page' , 1 ) - 1 ) * 5 ) ; }
Display a listing of the resource.
Display a listing of the resource .
//