Download Laravel-xCRUD Integration Full Code that includes this full demo
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class xManyToManyController extends Controller
{
public function index()
{
$xcrud = Xcrud_get_instance();
$xcrud->table('customers');
$xcrud->columns('customerNumber,Customer orders,city');
$xcrud->fk_relation('Customer orders','customerNumber','customers_orders_fk','customer_id','order_id','orders','orderNumber',array('orderNumber','orderDate'));
$render = $xcrud->render();
return view('xcrud_simple', ['render' => $render]);
}
}
# | Customernumber | Customer orders | City | |
---|---|---|---|---|
1 | 103 | 10180 2003-11-11 00:00:00 | Nantes | View Edit Remove |
2 | 112 | 10100 2023-07-29 00:00:00 | Las Vegas | View Edit Remove |
3 | 114 | 10100 2023-07-29 00:00:00, 10102 2023-01-18 | Melbourne | View Edit Remove |
4 | 119 | 10100 2023-07-29 00:00:00 | Nantes | View Edit Remove |
5 | 121 | 10100 2023-07-29 00:00:00, 10102 2023-01-18 | Stavern | View Edit Remove |
6 | 124 | San Rafael | View Edit Remove | |
7 | 125 | Warszawa | View Edit Remove | |
8 | 128 | Frankfurt | View Edit Remove | |
9 | 129 | San Francisco | View Edit Remove | |
10 | 131 | NYC | View Edit Remove |