2
votes

I have given a view URL as

<input type="hidden" id="urlview" urlview="{{ URL::route('Batch-InnerView/'.$batch->batch_id) }}" /> in view and my web route is 
Route::get('/Batch-InnerView/{id}',['as' => 'BatchInnerView', 'uses' => 'student\StudentBatchController@getView']);

showing error

ErrorException (E_ERROR) Route [/Batch-InnerView/1] not defined. (View: D:\vjcetcrm\resources\views\settings\student\Batch-InnerView.blade.php)

3

3 Answers

1
votes

Your route action put like this

urlview="{{ route('BatchInnerView',$batch->batch_id) }}" 
0
votes

Your route should be as below.

{{ route('BatchInnerView',$batch->batch_id) }}

And if you want to call it as URL then.

{{ url('Batch-InnerView/'.$batch->batch_id) }}
0
votes

Don't complicate yourself, try to write a sort code and clean code. You can try this Change this

Route::get('/Batch-InnerView/{id}',['as' => 'BatchInnerView', 'uses' => 'student\StudentBatchController@getView']);

To this

Route::get('/Batch-InnerView/{id}','student\StudentBatchController@getView')->name('BatchInnerView');

In your view just call it with

{{route('BatchInnerView',['id'=>$batch->batch_id])}}