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.
37 lines
1.0 KiB
37 lines
1.0 KiB
<?php
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Models\Business;
|
|
use App\Models\Status;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Response;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StatusController extends Controller
|
|
{
|
|
public function store($business, $workflow, Request $request)
|
|
{
|
|
permit('businessStatuses');
|
|
Status::create($request->merge(['business_id' => $business, 'workflow_id' => $workflow])->except('_business_info'));
|
|
return Business::info($business, true);
|
|
}
|
|
|
|
public function update($business, $workflow, $status, Request $request)
|
|
{
|
|
permit('businessStatuses');
|
|
$status = Status::findOrFail($status);
|
|
$status->update($request->except('_business_info'));
|
|
return Business::info($business, true);
|
|
}
|
|
|
|
public function delete($business, $workflow, $status)
|
|
{
|
|
permit('businessStatuses');
|
|
$status = Status::findOrFail($status);
|
|
$status->delete();
|
|
return Business::info($business, true);
|
|
}
|
|
}
|