added material CRUD
Cette révision appartient à :
Parent
e30fe18a41
révision
81bfe0f5f9
@ -49,16 +49,13 @@ public function store(AddNewRequest $request)
|
||||
$material->content = $contentName;
|
||||
}
|
||||
if ($material->save()) {
|
||||
$this->notice::success('Data Saved');
|
||||
return redirect()->route('material.index');
|
||||
return redirect()->route('material.index')->with('success', 'Data Saved');;
|
||||
} else {
|
||||
$this->notice::error('Please try again');
|
||||
return redirect()->back()->withInput();
|
||||
return redirect()->back()->withInput()->with('error', 'Please try again');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// dd($e);
|
||||
$this->notice::error('Please try again');
|
||||
return redirect()->back()->withInput();
|
||||
dd($e);
|
||||
return redirect()->back()->withInput()->with('error', 'Please try again');
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +72,7 @@ public function show(Material $material)
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$lesson= Course::get();
|
||||
$lesson= Lesson::get();
|
||||
$material = Material::findOrFail(encryptor('decrypt', $id));
|
||||
return view('backend.course.material.edit', compact('lesson', 'material'));
|
||||
}
|
||||
|
||||
@ -51,13 +51,13 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Course</label>
|
||||
<label class="form-label">Lesson</label>
|
||||
<select class="form-control" name="lessonId">
|
||||
@forelse ($lesson as $l)
|
||||
<option value="{{$l->id}}" {{old('lessonId')==$l->id?'selected':''}}>
|
||||
{{$l->title}}</option>
|
||||
@empty
|
||||
<option value="">No Course Found</option>
|
||||
<option value="">No Lesson Found</option>
|
||||
@endforelse
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -53,14 +53,14 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Course</label>
|
||||
<label class="form-label">Lesson</label>
|
||||
<select class="form-control" name="lessonId">
|
||||
@forelse ($lesson as $l)
|
||||
<option value="{{$l->id}}" {{old('lessonId', $material->lesson_id) ==
|
||||
$l->id?'selected':''}}>
|
||||
{{$l->title}}</option>
|
||||
@empty
|
||||
<option value="">No Course Material Material Found</option>
|
||||
<option value="">No Course Lesson Found</option>
|
||||
@endforelse
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Chargement…
Référencer dans un nouveau ticket
Block a user