Ya pretty thorough lol

So run `php artisan make:addon keevitaja.module.homepage`

keevitaja [6:01 PM] 

ryanthompson [6:01 PM] 
And now `php artisan make:stream products keevitaja.module.homepage`

keevitaja [6:02 PM] 

ryanthompson [6:02 PM] 
Ok now run `php artisan module:install keevitaja.module.homepage`

And you should be able to get there via the CP now (but pry get a 404)

keevitaja [6:02 PM] 

ryanthompson [6:03 PM] 
You’ll see the routes for products generated in your addons resources/routes/products.php

Copy those and put them in the routes array of your addons’ service provider

And you’ll wanna remove the trailing “/products” from it since it’s your addons default section - we want just "admin/homepage"

Also change “example” to “products” in your HomepageModule.php class

Let me know when you get there

keevitaja [6:05 PM] 
k, i think i am done

ryanthompson [6:06 PM] 
Can you reload and get an empty table?

at admin/homepage (edited)

keevitaja [6:06 PM] (67KB)

ryanthompson [6:07 PM] 

So real quick

Open that fields migration (first one)

and add ‘name’ => ‘anomaly.field_type.text'

Then open your products stream one and add ‘name’ to the assignments

keevitaja [6:08 PM] 

ryanthompson [6:08 PM] 
then run `php artisan migrate:refresh --addon=keevitaja.module.homepage`

Now your homepage_products table should have a name column in it

and admin/homepage/create should have the field

You see it?

keevitaja [6:09 PM] not found, 404

ryanthompson [6:09 PM] 
What’s your routes array

keevitaja [6:10 PM] 
protected $routes = [
       'admin/homepage' => 'Keevitaja\HomepageModule\Http\Controller\Admin\[email protected]',
       'admin/homepage/products/create' => 'Keevitaja\HomepageModule\Http\Controller\Admin\[email protected]',
       'admin/homepage/products/edit/{id}' => 'Keevitaja\HomepageModule\Http\Controller\Admin\[email protected]'

ryanthompson [6:10 PM] 
So that’s not routed - you wanna remove products from that entire set


keevitaja [6:10 PM]

ryanthompson [6:10 PM] 
Just cause it’s the first section

keevitaja [6:10 PM] 
this is working ... ok

ryanthompson [6:11 PM] 
Ok - so from here - you can repeat steps and add detail to your definitions. You can build it the thorough way or the quick way or any mixture of the two - I have to say - watch that video lol

It will tell you about the lang keys vs hard coded strings / field configurations / translations / etc / etc

But it would take me more than 1.5 hours to type it for you ^_^

Just wanted to get you on the right path

keevitaja [6:12 PM] (69KB)

why there is number one instead of the string?

ryanthompson [6:12 PM] 
Because you haven’t configured your table builder

(also in the vid / other addons you can checkout)

keevitaja [6:13 PM] 
ok, i think i can now use redirection plugin or something

what if i need to add fields?

ryanthompson [6:13 PM] 
By default it’s the title column which is the ID since you didn’t define one

keevitaja [6:13 PM] 
to the existing addon

ryanthompson [6:13 PM] 
just add them and refresh your migrations under that addon

And use the make:stream to add more stream migrations

That video is like gold though I think you’ll understand things much better after it

keevitaja [6:14 PM] 
and how do i iterate over the streams items?

ryanthompson [6:15 PM] 
You can use the entries plugin or if you assign a multiple field type to the page related to your home page products then you can iterate through them on the page like for product in page.products or whatever your field is

And that’s covered in the other video I put up

Actually - the same video

it goes over all that shit lol

keevitaja [6:15 PM] 
ok, thank you so much

ryanthompson [6:15 PM] 
Sure thing!

keevitaja [6:16 PM] 
and a tip for the screencasts. at least double your fontsize

ryanthompson [6:16 PM] 
ya 30” screen and didn’t do shit to it for readability :disappointed:


That was my 1st and 2nd ever lol

Please note that all pasted data is publicly available.