Okipa / laravel-table

Generate tables from Eloquent models.
MIT License
546 stars 65 forks source link

Column not extendable because of `self` #139

Closed Iaotle closed 1 year ago

Iaotle commented 1 year ago

I tried to extend the column to make a custom one but encountered an issue where the make method doesn't return an instance of the extended class but rather the parent. I think the better way would be to return new static($attribute) instead as that would return the child class as expected.

https://github.com/Okipa/laravel-table/blob/1b3d7db455f51156bc91cce55d5c74bdd98aa37b/src/Column.php#LL39C1-L42C6

Okipa commented 1 year ago

Hi @Iaotle, would make a PR with this change ? If there is no breaking change, I would merge this 👍