app/Http/Controllers/DashboardController.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()
    {
         $users = DB::table('users')
        ->join('cradits', 'users.id', '=', 'cradits.user_id')
        ->select('users.f_name', 'cradits.*')->simplePaginate(10);
         $users = DB::select('select * from cradits');
          $count = \DB::table('cradits')->count();
         $count = Cradit::where('credit','=','Credit')->count();
         $counts = Cradit::where('credit','=','Debit')->count();
    return view('admin.dashboard.dashboard',compact('users','count','counts'));
    }
public function index ( ) { $ users = DB :: table ( 'users' ) -> join ( 'cradits' , 'users.id' , '=' , 'cradits.user_id' ) -> select ( 'users.f_name' , 'cradits.*' ) -> simplePaginate ( 10 ) ; $ count = Cradit :: where ( 'credit' , '=' , 'Credit' ) -> count ( ) ; $ counts = Cradit :: where ( 'credit' , '=' , 'Debit' ) -> count ( ) ; return view ( 'admin.dashboard.dashboard' , compact ( 'users' , 'count' , 'counts' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
// //$users = DB::select('select * from cradits'); //  $count = \DB::table('cradits')->count();