I am new to laravel and I want to pass a data to display a new button for renewal of application when the user application is already more than one year. But if the application is not more than one year it will not display the renew button. I tried using blade @if else statement in the datatable but it does not display the information when I tried to use @if else statement using blade and it says:
DataTables warning: table id=dataTableBuilder - Ajax error. For more information about this error, please see http://datatables.net/tn/7
Here is the code in my
datatables_actions.blade.php
{!! Form::open(['route' => ['applicant.applications.destroy', $application_number], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{{ route('applicant.applications.show', $application_number) }}" class='btn btn-default btn-xs'>
<i class="glyphicon glyphicon-eye-open"></i>
</a>
@if ($application->created_at->gt(\Carbon\Carbon::now()->addYear()))
<a href="{{ route('applicant.applications.renew', $application_number) }}" class="btn btn-primary btn-xs">
</a>
@endif
<!-- <a href="{{ route('applicant.applications.edit', $application_number) }}" class='btn btn-default btn-xs'>
<i class="glyphicon glyphicon-edit"></i>
</a> -->
<!-- {!! Form::button('<i class="glyphicon glyphicon-trash"></i>', [
'type' => 'submit',
'class' => 'btn btn-danger btn-xs',
'onclick' => "return confirm('Are you sure?')"
]) !!} -->
</div>
{!! Form::close() !!}