return view('plan/index')->with('plans', \ceeacce\Plan::all()); }); Route::get('plan/{id}', function ($id) { return view('plan/plan')->with('plan', \ceeacce\Plan::find($id)); }); Route::get('students', function () { $defaultPagination = 20; return view('student/index')->with(['students' => \ceeacce\Student::orderBy('last_name_p', 'asc')->paginate($defaultPagination), 'campuses' => \ceeacce\Campus::all()]); }); Route::get('student/{id}', function ($id) { return view('student/student')->with(['student' => \ceeacce\Student::find($id), 'plans' => \ceeacce\Plan::all(), 'campuses' => \ceeacce\Campus::all()]); }); Route::get('campuses', function () { return view('campus/index')->with('campuses', \ceeacce\Campus::all()); }); Route::get('campus/{id}', function ($id) { return view('campus/campus')->with('campus', \ceeacce\Campus::find($id)); }); Route::post('student/import', 'Student\\StudentController@import'); Route::post('student/import/grades', 'Student\\StudentController@importGrades'); Route::post('students', function (\Illuminate\Http\Request $request) { $defaultPagination = 20; $searchString = $request->search; return view('student/index')->with(['students' => \ceeacce\Student::where('name', 'like', $searchString)->orWhere('last_name_p', 'like', $searchString)->orWhere('last_name_m', 'like', $searchString)->orderBy('last_name_p', 'asc')->paginate($defaultPagination), 'campuses' => \ceeacce\Campus::all()]); }); Route::post('student/save', 'Student\\StudentController@save'); Route::post('student/grades/save', 'Student\\StudentController@saveGrades'); }); View::composer('menu', function ($view) { $view->with('user', Auth::user()); });
<div class="table-responsive"> <table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>Id</th> <th>Clave</th> <th>Nombre Completo</th> <th>Plan de Estudio</th> <th>Plantel</th> </tr> </thead> <tbody> @foreach ($students as $student) <?php $campus = \ceeacce\Campus::find($student->campus); $plan = \ceeacce\Plan::find($student->plan); ?> <tr> <td>{{$student->id}}</td> <td>{{$student->clv}}</td> <td><a href="/student/{{$student->id}}">{{$student->last_name_p}} {{$student->last_name_m}} {{$student->name}} </a></td> <td>{{$plan->name}}</td> <td>{{$campus->name}}</td> </tr> @endforeach </tbody> </table> <div class="text-center"> {!! $students->render() !!} </div>