DEV Community

Ahmed AbdElLatif
Ahmed AbdElLatif

Posted on

1

Role/Status Based CRUD Application Using Laravel 7

This Application is demonstration for managing visa center applicants, in terms of receiving passports and managing visa status (received, pending, rejected or approved).

code sample for form that handle status with consideration to current status of a ticket:

<form @if($passport->status_id < 3) action="{{route('staff.passport.update',$passport->id)}}" method="post" @endif id="handleForm">
@if($passport->status_id < 3)
@csrf
{{method_field('PUT')}}
@endif
<div class="form-row">
<div class="form-group col-md-4">
<label>Status</label>
<select class="form-control" id="inputEmail4" name="status_id" @if($passport->status_id >= 3) readonly @endif>
@foreach($statuses as $status)
@if($passport->status_id < 3 && $passport->status_id <= $status->id)
<option value="{{$status->id}}">{{$status->statusName}}</option>
@endif
@endforeach
@if($passport->status_id >= 3)
<option>{{$passport->status->statusName}}</option>
@endif
</select>
</div>
<div class="form-group col-md-8">
<label>Comments</label>
<textarea class="form-control" name="details"></textarea>
</div>
</div>
<div class="form-row">
<input type="submit" class="btn btn-outline-primary btn-lg btn-block" @if($passport->status_id >= 3) disabled @endif>
</div>
</form>
view raw form.blade.php hosted with ❤ by GitHub

Also in this application I included a function assign a ticket to specific user to work on it.

This all come along side with basic dashboard to display aggregation of each status for last 30 days and for same day

Alt Text

So Let's go to the presentation

Top comments (2)

Collapse
 
zaxwebs profile image
Zack Webster

Well done.

Collapse
 
theahmedlatif profile image
Ahmed AbdElLatif

Thanks Zack, appreciated!

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay