本文整理匯總了PHP中app\Student::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Student::destroy方法的具體用法?PHP Student::destroy怎麽用?PHP Student::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Student
的用法示例。
在下文中一共展示了Student::destroy方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: destroy
public function destroy($id)
{
try {
$oldStudent = Student::findOrFail($id);
} catch (Exception $e) {
App::abort(404);
}
//Display flash msg on successful deletion
if (Student::destroy($id)) {
Session::flash('message', "Student '" . $oldStudent->name . "' deleted successfully. ");
return redirect()->route('students.index');
} else {
Session::flash('message', "Deleting student unsuccessful.");
return redirect()->route('students.index');
}
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
Student::destroy($id);
return redirect()->route('student.index');
}
示例3: destroy
/**
* Remove the specified resource from storage.
*
* @param Student $student
* @return Response
*/
public function destroy(Student $student)
{
$this->authorize('manage', new Student());
Student::destroy($id);
return redirect('student');
}
示例4: destroy
public function destroy($id)
{
return Student::destroy($id);
}
示例5: removeStudent
/**
* Remove a student
*
* @param $rollNo
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
*/
public function removeStudent($rollNo)
{
if ($rollNo != null) {
Student::destroy($rollNo);
}
return redirect('admins/manage/students');
}
示例6: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
Student::destroy($id);
return Redirect::route('student.show');
}