Category : sorting

i want to use a function (@lang) inside another function (@sortablelink). @lang: changed localisation depending on previous user input @sortablelink: kysliks sortable columns (https://github.com/Kyslik/column-sortable) Like this: @foreach($COLUMNS_TASK as $column => $val) <div class="th"> <a href=""><p class="justify-content-center text-center">@sortablelink($val, @lang(‘lang.’.$val))</p></a> </div> @endforeach When i run this code, i am getting this error: Error Call to undefined function ..

Read more

I’m trying to sort or order the products based on their category. But it’s not affecting the output. Please see my code below. Controller return DB::table(‘products’) ->Join(‘categories’, ‘categories.id’,’=’,’products.category_id’) ->select(‘id’, ‘name’, ‘categories.sort’) ->orderBy(‘categories.sort’, ‘asc’) ->paginate(10); Output id | name | sort 1 | Soup1 | 3 2 | Soup2 | 4 3 | Soup3 | 2 ..

Read more

I’ve been able to sort data in my tables but I’m trying to get it so that when I click on a column header it sorts the data by that header category. Route Route::get(‘/sort’, ‘[email protected]’)->name(‘contacts.sort’); Route::get(‘/sortDesc’, ‘[email protected]’)->name(‘contacts.sortDesc’); index.blade.php @extends(‘layouts.master’) @section(‘content’) <div class=”container”> <div> <div style=”margin-top:10px;”> <h3>Contacts</h3> </div> <div style=”margin-top:10px; margin-bottom:10px;”> <a class=”btn btn-sm btn-success” href=”{{ ..

Read more