Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.49k stars 220 forks source link

Deprecated method`addColumns()` - use `fields()` #1355

Closed luanfreitasdev closed 8 months ago

luanfreitasdev commented 8 months ago

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

Description

This Pull Request adds...

Related Issue(s): #_____.

Documentation

This PR requires Documentation update?

LeandroAndrade2020 commented 8 months ago

I did an installation from scratch with laravel 10.43 and installed livewire 3 and then installed powergrid 5, I've done different installations and always getting this error:

Method PowerComponents\LivewirePowerGrid\PowerGridFields::addColumn does not exist.

And showing that it is in this part of the code:

public function fields(): PowerGridFields

{

return PowerGrid::fields()

    ->addColumn('id')

    ->addColumn('name')

    ->addColumn('email')

    ->addColumn('created_at_formatted', fn (User $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));

}