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

<?php
namespace App\Http\Controllers;
use App\Models\Sprint;
use App\Models\Business;
use Illuminate\Http\Request;
class SprintController extends Controller
{
public function store($business, $project, Request $request)
{
permit('projectSprints', ['project_id' => $project]);
Sprint::create($request->merge(
['business_id' => $business, 'project_id' => $project]
)->except('_business_info'));
return Business::info($business, true);
}
public function update($business, $project, $sprint, Request $request)
{
permit('projectSprints', ['project_id' => $project]);
$sprint = Sprint::findOrFail($sprint);
$sprint->update($request->except('_business_info'));
return Business::info($business, true);
}
public function delete($business, $project, $sprint)
{
permit('projectSprints', ['project_id' => $project]);
$sprint = Sprint::findOrFail($sprint);
$sprint->delete();
return Business::info($business, true);
}
}