Refer to URL via resource()
This commit is contained in:
parent
6b0d7d8ea4
commit
dd400806ee
@ -37,7 +37,7 @@ Route::group([
|
||||
# pirep related routes
|
||||
Route::resource('pireps', 'PirepController');
|
||||
Route::match(['get'], 'pireps/pending', 'PirepController@pending');
|
||||
Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status');
|
||||
Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status')->name('pirep.status');
|
||||
|
||||
Route::resource('pirepfields', 'PirepFieldController');
|
||||
|
||||
|
@ -10,13 +10,16 @@
|
||||
</a>
|
||||
</h5>
|
||||
<div>
|
||||
@if($pirep->state == PirepState::PENDING)
|
||||
<div class="badge badge-warning">Pending</div>
|
||||
@if($pirep->state === PirepState::PENDING)
|
||||
<div class="badge badge-warning">
|
||||
@elseif($pirep->state === PirepState::ACCEPTED)
|
||||
<div class="badge badge-success">Accepted</div>
|
||||
<div class="badge badge-success">
|
||||
@elseif($pirep->state === PirepState::REJECTED)
|
||||
<div class="badge badge-danger">
|
||||
@else
|
||||
<div class="badge badge-danger">Rejected</div>
|
||||
<div class="badge badge-info">
|
||||
@endif
|
||||
{!! PirepState::label($pirep->state) !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
@ -57,7 +60,8 @@
|
||||
<td>
|
||||
@if($pirep->state == PirepState::PENDING
|
||||
|| $pirep->state == PirepState::REJECTED)
|
||||
{!! Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/status'), 'method' => 'post',
|
||||
{!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'accept_'.$pirep->id,
|
||||
'id' => $pirep->id.'_accept',
|
||||
'pirep_id' => $pirep->id,
|
||||
@ -71,7 +75,8 @@
|
||||
<td>
|
||||
@if($pirep->state == PirepState::PENDING
|
||||
|| $pirep->state == PirepState::ACCEPTED)
|
||||
{!! Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/status'), 'method' => 'post',
|
||||
{!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'reject_'.$pirep->id,
|
||||
'id' => $pirep->id.'_reject',
|
||||
'pirep_id' => $pirep->id,
|
||||
|
Loading…
Reference in New Issue
Block a user