Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

returning two yajra datatable using single method on the sam view laravel

public function index(ProductsDataTable $productDatatable, UsersDataTable $userDatatable)
{    
if (request()->has('product') {
    return $productDatatable->render('view');
}

if (request()->has('user') {
    return $productDatatable->render('view');
}

$user = Auth::user();

$products = $user->products;

return view('admin.dashboard', compact('products', 'user', 'productDatatable', 'userDatatable'));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #returning #yajra #datatable #single #method #sam #view #laravel
ADD COMMENT
Topic
Name
6+1 =