You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.0 KiB

  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Models\Sprint;
  4. use App\Models\Business;
  5. use Illuminate\Http\Request;
  6. class SprintController extends Controller
  7. {
  8. public function store($business, $project, Request $request)
  9. {
  10. permit('projectSprints', ['project_id' => $project]);
  11. Sprint::create($request->merge(
  12. ['business_id' => $business, 'project_id' => $project]
  13. )->except('_business_info'));
  14. return Business::info($business, true);
  15. }
  16. public function update($business, $project, $sprint, Request $request)
  17. {
  18. permit('projectSprints', ['project_id' => $project]);
  19. $sprint = Sprint::findOrFail($sprint);
  20. $sprint->update($request->except('_business_info'));
  21. return Business::info($business, true);
  22. }
  23. public function delete($business, $project, $sprint)
  24. {
  25. permit('projectSprints', ['project_id' => $project]);
  26. $sprint = Sprint::findOrFail($sprint);
  27. $sprint->delete();
  28. return Business::info($business, true);
  29. }
  30. }