Download Laravel-xCRUD Integration Full Code that includes this full demo
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class xOrderingController extends Controller
{
public function index()
{
$xcrud = Xcrud_get_instance();
$xcrud->table('offices');
$xcrud->button('#', "Top", 'glyphicon glyphicon-arrow-up icon-arrow-up', 'btn xcrud-action', array(
'data-action' => 'movetop',
'data-task' => 'action',
'data-primary' => '{officeCode}'));
$xcrud->button('#', "Bottom", 'glyphicon glyphicon-arrow-down icon-arrow-down', 'btn xcrud-action', array(
'data-action' => 'movebottom',
'data-task' => 'action',
'data-primary' => '{officeCode}'));
$xcrud->create_action('movetop', 'movetop');
$xcrud->create_action('movebottom', 'movebottom');
$xcrud->unset_sortable();
$xcrud->order_by('ordering');
$xcrud->columns('city,phone,addressLine1,country');
$render = $xcrud->render();
return view('xcrud_simple', ['render' => $render]);
}
}
# | City | Phone | Addressline1 | Country | |
---|---|---|---|---|---|
1 | San Francisco | +1 650 219 4782 | 100 Market Street | USA | Top Bottom View Edit Remove |
2 | Boston | +1 215 837 0825 | 1550 Court Place | USA | Top Bottom View Edit Remove |
3 | NYC | +1 212 555 3000 | 523 East 53rd Street | USA | Top Bottom View Edit Remove |
4 | Paris | +33 14 723 4404 | 43 Rue Jouffroy D'abbans | France | Top Bottom View Edit Remove |
5 | Sydney | +61 2 9264 2451 | 5-11 Wentworth Avenue | Australia | Top Bottom View Edit Remove |
6 | London | +44 20 7877 2041 | 25 Old Broad Street | UK | Top Bottom View Edit Remove |
7 | Tokyo | +81 33 224 5000 | 4-1 Kioicho | Japan | Top Bottom View Edit Remove |