Route report.expAlert error (View: /home/grocersa/edesimarket.com/resources/views/layout/main.blade.php (i defined all place but not triggered plz help to find out)
This is my web.php file coding
Route::get('report/product_quantity_alert', 'ReportController@productQuantityAlert')->name('report.qtyAlert');
Route::get('report/product_expiry_alert', 'ReportController@productExpiryAlert')->name('report.expAlert');
Route::get('report/warehouse_stock', 'ReportController@warehouseStock')->name('report.warehouseStock');
This my main.blade.php coding
for sidebar (nav - menu )
@if($product_exp_alert_active)
<li id="expAlert-report-menu">
<a href="{{route('report.expAlert')}}">{{trans('file.Product Expiry Alert')}}</a>
</li>
@endif
for user permission
@if($product_qty_alert_active || $product_exp_alert_active)
for database & roll permission
$product_qty_alert_active = DB::table('permissions')
->join('role_has_permissions', 'permissions.id', '=', 'role_has_permissions.permission_id')
->where([
['permissions.name', 'product-qty-alert'],
['role_id', $role->id] ])->first();
$product_exp_alert_active = DB::table('permissions')
->join('role_has_permissions', 'permissions.id', '=', 'role_has_permissions.permission_id')
->where([
['permissions.name', 'product-exp-alert'],
['role_id', $role->id] ])->first();
for define
@if($alert_product > 0)
<li class="nav-item">
<a rel="nofollow" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-item"><i class="dripicons-bell"></i><span class="badge badge-danger">{{$alert_product}}</span>
</a>
<ul class="dropdown-menu edit-options dropdown-menu-right dropdown-default notifications" user="menu">
<li class="notifications">
<a href="{{route('report.qtyAlert')}}" class="btn btn-link"> {{$alert_product}} product exceeds alert quantity</a>
</li>
<li class="notifications">
<a href="{{route('report.expAlert')}}" class="btn btn-link"> {{$alert_product}} product expiry alert</a>
</li>
</ul>
</li>
@endif
This is my reportcontroller.php coding
class ReportController extends Controller
{
public function productQuantityAlert()
{
$role = Role::find(Auth::user()->role_id);
if($role->hasPermissionTo('product-qty-alert')){
$lims_product_data = Product::select('name','code', 'image', 'qty', 'alert_quantity')->where('is_active', true)->whereColumn('alert_quantity', '>', 'qty')->get();
return view('report.qty_alert_report', compact('lims_product_data'));
}
else
return redirect()->back()->with('not_permitted', 'Sorry! You are not allowed to access this module');
}
public function productExpiryAlert()
{
$role = Role::find(Auth::user()->role_id);
if($role->hasPermissionTo('product-exp-alert')){
$lims_product_data = Product::select('name','code', 'image', 'qty', 'alert_expiry')->where('is_active', true)->whereColumn('alert_expiry', '>', 'name')->get();
return view('report.exp_alert_report', compact('lims_product_data'));
}
else
return redirect()->back()->with('not_permitted', 'Sorry! You are not allowed to access this module');
}