I'm trying to view some data in the database using route.. but in the url it shows it with the id of what i'm trying to view.. like jobs/client_job/1 which shows the details of the job with id of 1 so it makes it easy for a user to change the value and get info of another persons data..
this is what i tried
my route
Route::get('/view_job/{client_job}', ['uses' => 'ClientController@view_job', 'as' => 'client_view_job', 'middleware' => 'auth:clients']);
My controller and i've added the Facades
use Illuminate\Support\Facades\Crypt;
public function view_job(ClientJobModel $client_job){
if(Auth::guard('developers')->check()){
return redirect()->route('developer_dashboard');
}
return view('master.clients.jobs.view_job')->with('job', Crypt::decrypt($client_job));
}
The view i'm coming from
<a href="{{ route('client_view_job', ['client_job' => Crypt::encrypt($job->id) ]) }}">View Details <i class="fa fa-fw fa-arrow-circle-right"></i></a>  
The view i'm going to
@if ($job->email == Auth::guard('clients')->user()->email)
<div class="panel panel-primary">
<div class="panel-heading" style="font-size: 20px;">
Title: {{ $job->job_title }}
</div>
<div class="panel-body clearfix">
{{ $job->job_description }}
</div>
<div class="panel-footer clearfix">
<div class="pull-left">
Created At: {{ date('M j, Y', strtotime($job->created_at))}}
</div>
<div class="pull-right">
<a href="#">Edit <i class="fa fa-fw fa-edit"></i></a>  
<a href="#">Delete <i class="fa fa-fw fa-times"></i></a>
</div>
</div>
</div>
@else
<div class="panel panel-danger">
<div class="panel-heading" style="font-size: 20px;">
Does Not Exist
</div>
<div class="panel-body clearfix">
Please <a href="{{ route('client_dashboard')}}">go back </a>
</div>
</div>
@endif
Pls help