当前位置: 首页>>代码示例>>PHP>>正文


PHP Question::destroy方法代码示例

本文整理汇总了PHP中app\Question::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::destroy方法的具体用法?PHP Question::destroy怎么用?PHP Question::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Question的用法示例。


在下文中一共展示了Question::destroy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Question::destroy($id);
     \Session::flash('success', 'Question is successfully deleted.');
     return redirect('questions');
 }
开发者ID:phpclub,项目名称:GA-Exam,代码行数:12,代码来源:QuestionsController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Question::destroy($id);
     return response()->json(array('msg' => 'delete successfully'));
 }
开发者ID:EManual,项目名称:interview,代码行数:11,代码来源:QuestionController.php

示例3: getDeleteQuestion

 public function getDeleteQuestion($id)
 {
     $subj_id = Question::find($id)->subject->id;
     Question::destroy($id);
     session()->flash('flash_mess', 'Question #' . $id . ' was deleted');
     return redirect(action('SubjectController@getQuestions', $subj_id));
 }
开发者ID:imladrisol,项目名称:onlineExam,代码行数:7,代码来源:SubjectController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  Question $question
  * @return \Illuminate\Http\Response
  */
 public function destroy(Question $question)
 {
     // delete question image
     File::exists(public_path($question->question_image)) ? File::delete(public_path($question->image_question)) : null;
     File::exists(public_path($question->answer1_image)) ? File::delete(public_path($question->answer1_image)) : null;
     File::exists(public_path($question->answer2_image)) ? File::delete(public_path($question->answer2_image)) : null;
     File::exists(public_path($question->answer3_image)) ? File::delete(public_path($question->answer3_image)) : null;
     File::exists(public_path($question->answer4_image)) ? File::delete(public_path($question->answer4_image)) : null;
     Question::findOrFail($question->id) ? Question::destroy($question->id) : null;
     flash('Question is deleted');
     return redirect('questions');
 }
开发者ID:2ppaamm,项目名称:mathImageall,代码行数:18,代码来源:QuestionController.php


注:本文中的app\Question::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。