create history api
This commit is contained in:
@@ -24,8 +24,10 @@ class DetailController extends Controller
|
||||
*/
|
||||
public function histories(Harim $harim): JsonResponse
|
||||
{
|
||||
throw_if($this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id, new ProhibitedAction("unauthorized"));
|
||||
throw_if($harim->province_id != auth()->user()->province_id, new ProhibitedAction("شما دسترسی لازم جهت مشاهده ی این صفحه را ندارید"));
|
||||
|
||||
return $this->successResponse($harim->histories()->get(['id', 'expert_description', 'action_name', 'previous_state_name']));
|
||||
return $this->successResponse($harim->histories()
|
||||
->orderBy('id', 'desc')
|
||||
->get(['id', 'expert_description', 'action_name', 'previous_state_name']));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user