Route::resource('promotionadvances', 'PromotionAdvancesController'); Route::post('promotionexceptionals/getData', 'PromotionExceptionalsController@getData'); Route::resource('promotionexceptionals', 'PromotionExceptionalsController'); Route::post('earlysubscriptions/getClassWhenLevelid', 'EarlySubscriptionsController@getClassWhenLevelid'); Route::resource('earlysubscriptions', 'EarlySubscriptionsController'); /* Gallery room */ Route::get('gallery', function () { return view('gallery3d.index'); })->middleware(['auth', 'admin']); /* Gallery Room*/ Route::get('pdf', function () { $page = substr(URL::previous(), -1); if (is_null($page)) { $page = 1; } else { $model = App\Matter::where('user_id', \Auth::user()->id)->forPage($page, 5)->get(['nom_matiere', 'code_matiere']); Excel::create('Sheetname', function ($excel) use($model) { $excel->sheet('Sheetname', function ($sheet) use($model) { $sheet->fromModel($model); $sheet->setStyle(array('font' => array('name' => 'Calibri', 'size' => 13))); $sheet->setAllBorders('thin'); $sheet->cells('A1:B1', function ($cells) { $cells->setBackground('#97efee'); // header only $cells->setFont(array('family' => 'Calibri', 'size' => '14', 'bold' => true)); }); $sheet->row(1, array('Nom Matière', 'Code Matière')); }); })->export('pdf'); } });
@section('content') @include('partials.alert-errors') @include('partials.alert-success') <div class="row"> <div class="col-sm-3"> <section class="panel"> <header class="panel-heading"> Matières </header> <div class="panel-body"> <?php $matieres = App\Matter::where('user_id', \Auth::user()->id)->get(); ?> <table class="table table-hover general-table"> {!! Form::model($cr,['url'=> action('ClassroomsController@update',[$cr]),'method'=>'put']) !!} <tbody> @foreach($cr->matters as $mat) @foreach($matieres as $matiere) @if($matiere->id == $mat->id) <tr> <td><div class="checkbox_liste2"> <input name="select[]" type="checkbox" checked value="{{ $mat->id }}"> </div> <span><strong>{{ $mat->nom_matiere }}</strong></span></td> </tr> @endif