# |
May 26th 2017, 14:32 |
rudy1976s |
@jeremyharris so I can almost do anything if the registry is available at that time |
# |
May 26th 2017, 14:31 |
jeremyharris |
@rudy1976s in the migration file you can load up the table registry and do finds and such if you need to |
# |
May 26th 2017, 14:30 |
rudy1976s |
I also need to make conditional work on my migrations: I need to add some columns only if they are not |
# |
May 26th 2017, 14:30 |
spriz |
@jeremyharris we tend to put that as raw sql in the migrations |
# |
May 26th 2017, 14:29 |
jeremyharris |
yeah it’s just annoying when you want to seed the database with some defaults (say I add a table via migrations and want default records in there). End up putting a bunch of extra stuff in the migrations |
# |
May 26th 2017, 14:29 |
rudy1976s |
AH ok, |
# |
May 26th 2017, 14:28 |
spriz |
https://en.wikipedia.org/wiki/Database_seeding |
# |
May 26th 2017, 14:28 |
spriz |
Aye, point is seeds aren't one-off things like migrations |
# |
May 26th 2017, 14:28 |
jeremyharris |
didn’t want to offend anyone |
# |
May 26th 2017, 14:28 |
jeremyharris |
I was gonna say “probably hand-rolled” :P |
# |
May 26th 2017, 14:27 |
jeremyharris |
I think phinx seeds run each time like migrations do… which is annoying. do laravel seeds run even if they’ve run before |
# |
May 26th 2017, 14:27 |
rudy1976s |
@sprix what is “seeds” ? |
# |
May 26th 2017, 14:27 |
spriz |
as with everything else, they roll their own implementation ,:( |
# |
May 26th 2017, 14:27 |
spriz |
unfortunately not |
# |
May 26th 2017, 14:27 |
spriz |
nope |
# |
May 26th 2017, 14:27 |
jeremyharris |
does laravel use phinx? |
# |
May 26th 2017, 14:26 |
spriz |
I have a laravel side-project where I do though :slightly_smiling_face: |
# |
May 26th 2017, 14:26 |
rudy1976s |
I ask this because I am used to create migrations under Yii2 and now I need to do the same with cake |
# |
May 26th 2017, 14:26 |
spriz |
we don't on my cake project @jeremyharris |
# |
May 26th 2017, 14:26 |
jeremyharris |
sprix do you use seeds yourself? I’ve got a question about them |
# |
May 26th 2017, 14:26 |
spriz |
@rudy1976s but you can just put raw SQL in the migrations and populate data by thta ;) |
# |
May 26th 2017, 14:26 |
spriz |
@rudy1976s - that sounds more like seeds :slightly_smiling_face: |
# |
May 26th 2017, 14:25 |
rudy1976s |
Hello , I am using migrations: is there a way to use migrations for populating data too ? or to do some other stuffs ? |
# |
May 26th 2017, 14:22 |
deco |
Thank you! |
# |
May 26th 2017, 14:22 |
jeremyharris |
cool, glad to help! |
# |
May 26th 2017, 14:22 |
deco |
@jeremyharris Yeah, that's what I'm looking for. Thanks! |
# |
May 26th 2017, 14:22 |
jeremyharris |
so if you made those entities implement an interface that had a method, say getTotal that was implemented in each entity. Entity A’s getTotal might return it’s “total” property while entity B’s getTotal might return it’s “amount” property |
# |
May 26th 2017, 14:22 |
spriz |
holy smokes - if there is no boilerplate function for a crud function even though it's enabled - it passes all auth :thinking_face: |
# |
May 26th 2017, 14:21 |
jeremyharris |
deco yes you could. What I’m mean by the shared interface is, if you use ->match(‘propertyName’) it would *require* propertyName to exist on both types of entities |
# |
May 26th 2017, 14:19 |
deco |
Or would I need to implement a shared interface for that? |
# |
May 26th 2017, 14:19 |
deco |
@jeremyharris Ok. Could I then ->match() the hole collection for a key and retrieve both type of entities? |
# |
May 26th 2017, 14:15 |
jeremyharris |
deco you could put them in a collection, but you’d just have to be aware of any differences when using collection methods (unless they have a shared interface you can rely on) |
# |
May 26th 2017, 14:11 |
deco |
Good day! I have two type of entities can I create a collection with these two types? Or would it be wiser to put each entity type in it's own collection? I'm aggregating different data sets to generate a dashboard. |
# |
May 26th 2017, 13:59 |
spriz |
if I remove the $this->loadComponent everything works - but as soon as I load Crud - there is no authentication or authorization |
# |
May 26th 2017, 13:56 |
spriz |
although $this->Auth shows the right things in it :thinking_face: |
# |
May 26th 2017, 13:56 |
spriz |
it doesn't get into the isAuthorized at all |
# |
May 26th 2017, 13:56 |
spriz |
anyone have a tip on why my Crud controllers skip my Auth ? :thinking_face: |
# |
May 26th 2017, 13:50 |
megan |
awesome :) |
# |
May 26th 2017, 13:50 |
popperz0r |
found it! :slightly_smiling_face: |
# |
May 26th 2017, 13:50 |
grymmjack |
@megan thanks. i'll check that out. |
# |
May 26th 2017, 13:49 |
Neon1024 |
Ahok, was just curious |