public function destroy(Project $project)
 {
     if (!$project->hasOne(Todo::class)->exists()) {
         $project->delete();
     }
     return redirect('/projects');
 }
示例#2
0
 /**
  * @depends testCreateEmptyProject
  * @param Project $project
  */
 function testMakeProjectArchived(Project $project)
 {
     $this->_userLoginIn();
     $project->delete();
     $this->assertTrue($project->trashed());
     $project->restore();
     $this->assertFalse($project->trashed());
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  \App\Project $project
  * @return Response
  */
 public function destroy(Project $project)
 {
     $project->delete();
     return Redirect::route('projects.index')->with('message', 'Project deleted.');
 }
 /**
  * soft delete a project
  * 
  * @param Project $project
  */
 public function archive(Project $project)
 {
     $project->delete();
     return $this->show($project);
 }
示例#5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  App\Project $project
  * @return Response
  */
 public function destroy(Project $project)
 {
     $project->delete();
     return redirect('/project')->with('success', 'Sukses menghapus proyek ' . $project->nama_project . '.');
 }
示例#6
0
    Route::auth();
    // PROJECTS
    /**
     * Show Projects Dashboard
     */
    Route::get('/projects/', function () {
        $projects = Project::orderBy('created_at', 'asc')->get();
        return view('projects', ['projects' => $projects]);
    });
    /**
     * Add New Project
     */
    Route::post('/projects/project', function (Request $request) {
        $validator = Validator::make($request->all(), ['name' => 'required|max:255', 'leader' => 'required|max:255']);
        if ($validator->fails()) {
            return redirect('/projects')->withInput()->withErrors($validator);
        }
        $project = new Project();
        $project->name = $request->name;
        $project->leader = $request->leader;
        $project->save();
        return redirect('/projects');
    });
    /**
     * Delete Project
     */
    Route::delete('/projects/{project}', function (Project $project) {
        $project->delete();
        return redirect('/projects');
    });
});
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Project $project)
 {
     //
     if ($project->delete()) {
         return redirect('proyectos');
     }
 }
 public function destroy(Project $project)
 {
     $project->delete();
     return redirect('projects')->with(['flash_message' => 'Your project has been deleted.']);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  Project  $project
  * @return \Illuminate\Http\Response
  */
 public function destroy(Project $project)
 {
     $project->delete();
     return redirect()->route('project.index');
 }
 /**
  * Delete the project entirely.
  *
  * @param Project $project
  * @throws \Exception
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function delete(Project $project)
 {
     // Delete the projects images.
     foreach ($project->images as $image) {
         $image->delete();
     }
     // Delete the projects documents.
     foreach ($project->documents as $document) {
         $document->delete();
     }
     // Delete the project.
     $project->delete();
     Session::flash('flash_message', trans('create-project-form.delete-success'));
     return redirect('create-project');
 }
 public function deleteProject(Request $request, Project $project)
 {
     //$this->authorize('destroy', $tag); ToDo::policy
     $project->delete();
     return redirect('/portfolio');
 }
 /**
  * Delete an existing project from storage.
  *
  * @param Project $project
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  * @throws \Exception
  */
 function manageProjectDestroy(Project $project)
 {
     $project->delete();
     return redirect('admin/projects');
 }
示例#13
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  App\Client $client
  * @param  App\Project $project
  * @return \Illuminate\Http\Response
  */
 public function delete(Client $client, Project $project)
 {
     $project->delete();
     return redirect()->route('clients.show', [$client]);
 }
 public function deleteProject(Project $project)
 {
     $project->delete();
     return ["message" => "删除成功"];
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  Project $project
  * @return \Illuminate\Http\Response
  */
 public function destroy(Project $project)
 {
     $project->delete();
     Session::flash('flash_message', 'Project deleted successfully!');
     return Redirect::route('projects.index')->with('message', 'Project deleted.');
 }
示例#16
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Project $project
  * @return \Illuminate\Http\Response
  * @internal param int $id
  */
 public function destroy(Project $project)
 {
     $project->delete();
     return redirect('projects');
 }
示例#17
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Project 	$project
  * @return Response
  */
 public function destroy(Project $project)
 {
     foreach ($project->images as $image) {
         $this->delete($image);
     }
     $project->delete();
     return redirect('m/danh-sach-nha-dat/du-an')->with('flash_message', Lang::get('system.destroy'));
 }
示例#18
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Project $project
  * @internal param int $id
  * @return Response
  */
 public function destroy(Project $project)
 {
     if ($project->todos) {
         foreach ($project->todos as $todos) {
             if (!$todos->completed) {
                 Flash::error('This project has incomplete todos.  Mark them as completed or remove them.');
                 return redirect()->route('projects.todos.index', [$project->id]);
             }
         }
     }
     $project_array = $project->toArray();
     $emails = $project->subscribers()->lists('email');
     Mail::send('projects.emails.delete', ['name' => $project->name, 'user' => $project->user->name], function ($message) use($emails, $project_array) {
         $message->from('*****@*****.**');
         $message->to($emails)->subject("USC Todo App - The '{$project_array['name']}' project has been removed!");
     });
     $project->delete();
     Flash::success('The project has been deleted!');
     return redirect()->route('projects.index');
 }