vkovic / laravel-custom-casts

Make your own custom cast type for Laravel model attributes
MIT License
219 stars 21 forks source link

Parameters #18

Closed Marko298 closed 2 years ago

Marko298 commented 4 years ago

In native laravel cast, you can add params for casts. For example date. Adding this feature gives more control over casting process.

class User extends Model {
  protected $casts = [
    'avatar' => 'file:disk',
  ];
}
vkovic commented 4 years ago

Funny, I was thinking the same thing since we (@jimhlad and me) added support for the named casts but in the lack of time I was unable to work on it.

@Marko298 Maybe you can check the code, as you already did some cool changes and try to implement this one - i'll support you.

Of course if you do not have time yourself, I'm planning to do this in the couple of weeks.

Cheers 🍻

Marko298 commented 4 years ago

I wrote down this in order to have some plans. I will create pull requests to all features on the weekend

vkovic commented 4 years ago

Great!

Marko298 commented 4 years ago

I like the idea of this package a lot and I think it will have a great future.