Trying to access array offset on value of type bool

A latest enterprise version with laravel 10 is not working with me.

Trying to access array offset on value of type bool

public function admin_geo_parts()

{

    $database = $this->_getDatabaseConnection();
    $config = config('grocerycrud');

    $crud = new GroceryCrud($config, $database);

    // Don't forget those two below lines if you are 
    // using CSRF protection (enabled by default on Laravel 10)
    $crud->setCsrfTokenName('_token');
    $crud->setCsrfTokenValue(csrf_token());
$crud->setTable('parts');
$crud->setSubject('Customer', 'Customers');

$output = $crud->render();

return $this->_showOutput($output);


         }

Hello @gelinger ,

That’s really weird! Can you var_dump the $output to see that we are getting the expected results?

For example:

var_dump($output);
die;

Also maybe to have the function inside a try catch? Maybe something like this?

try {
  $database = $this->_getDatabaseConnection();
    $config = config('grocerycrud');

    $crud = new GroceryCrud($config, $database);
...
$output = $crud->render();

} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

will give a better error message?

The error is very misleading to be honest. Are you using any third-party library? Also what version of Grocery CRUD Enterprise are you using?

Regards
Johnny

Var_dump($output) will not help as the error happens on

$crud->render();

I have used this as an example

Install Grocery CRUD Enterprise in Laravel 10 | Grocery CRUD v3

[

Install Grocery CRUD Enterprise in Laravel 10 Grocery CRUD v3

Create a full stable PHP CRUD with few lines of code.


](Install Grocery CRUD Enterprise in Laravel 10 | Grocery CRUD v3)

The error happens on the ajax request to /geo-parts?action=initial