skegel
skegel

Sean Kegel

@skegel

Lead Software Engineer @ Curology

16 Posts 123 Views

  • No matching results...
  • Searching...

/ 255

I was writing out a method today that accepted an array of items as a parameter. I always try to type the array using something like: `MyObject[]`. That got me thinking about what type I should use though? Do you use `array`, `iterable`, or `Collection` if you're in the Laravel world?

2

490

Just saved the thread to Readwise and will read soon, thanks!

233

Does anyone use Laravel Pennant to store user settings? For example, I have a multi-tenant app and a user can belong to multiple tenants. I want to store which tenant is currently the user's active tenant. Does that make sense or is that best left out of Pennant?

1

174

The pivot would have a `is_current` field on it so you would look for tenants for the user with `is_current` set. However, that requires the extra work of deselecting the previous one. Though, maybe that’s solved by using a timestamp instead.

1

138