columns(array $columns)

Specify the fields that the end user will see as the datagrid columns. An example of the syntax is the below:

$crud->columns(['first_name', 'last_name', 'age']);

If you want to check a full working example you can see the below example. The table customers has something like 12 fields, however at the datagrid we want to show only 4 columns:

$crud->setSubject('Customer', 'Customers');

$output = $crud->render();

So the above code will produce the below working example: