示例#1
0
 /**
  * Report a bug to the support team.
  * Send an e-mail to the support team
  *
  * @return \Illuminate\Http\Response
  */
 public function report(Request $request)
 {
     $bug = new Bug();
     $bug->comment = $request->input('comment');
     $bug->img = $request->input('img');
     $bug->save();
     return 'true';
 }
示例#2
0
 public function store()
 {
     $title = Input::get('title');
     $description = Input::get('description');
     $status = Input::get('status');
     $priority = Input::get('priority');
     $user = Input::get('user_id');
     $bug = new Bug();
     $bug->title = $title;
     $bug->description = $description;
     $bug->status = $status;
     $bug->priority = $priority;
     $bug->user_id = $user;
     $bug->save();
     return redirect('bugs');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(BugStoreRequest $request)
 {
     $bug = new Bug();
     $bug->project_id = $request->input('project_id');
     $bug->title = $request->input('title');
     $bug->pre_conditions = $request->input('pre_conditions');
     $bug->version = $request->input('version');
     $bug->steps_to_reproduce = $request->input('steps_to_reproduce');
     $bug->description = $request->input('description');
     $bug->desired_situation = $request->input('desired_situation');
     try {
         if ($bug->save()) {
             Notification::success(trans('messages.bug.created'));
             return redirect()->route('bugs.show', $bug->id);
         }
         Notification::error(trans('messages.bug.createFailed'));
     } catch (Exception $e) {
         Notification::error($e->getMessage());
     }
     return back()->withInput();
 }
示例#4
0
 public function edit()
 {
     $id = Input::get('id');
     $title = Input::get('title');
     $description = Input::get('description');
     $status = Input::get('status');
     $bug = Bug::find($id);
     $bug->title = $title;
     $bug->description = $description;
     $bug->status = $status;
     $bug->save();
     return redirect('home');
 }
示例#5
0
 public function fetchContainers()
 {
     return ['opened' => Bug::where('status', Bug::OPENED)->count(), 'closed' => Bug::where('status', Bug::CLOSED)->count(), 'all' => Bug::count()];
 }