Day 5: Dynamic Rendering
Summary
Before I went to bed yesterday I decided to lean into the Rhizome theme a bit harder and renamed Sites to Shoots. Along that same these instead of creating sites we’ll be sprouting shoots. I did not rename anything in the database, middleware, or controller. I just changed the views to reflect the botanical theme.
For Day 5 my goal was to transform shoots from identical placeholders into dynamic pages by allowing users to define a description and a theme color during the “sprouting” process.
Today’s Definition of Done:
- The sites table includes description (text) and theme_color (string) columns.
- The “Sprout a New Shoot” form on the dashboard includes inputs for these two new fields.
- Submitting the form correctly saves the description and color to the database
- Visiting a shoot’s subdomain displays that shoot’s description instead of a hardcoded message.
Work Session
Starting off today I knew I needed to add two new colums to the site table so back to php artisan for another migration.
| |
Inside the migration I added a nullable description of type text and a string for theme color that defaults to green.
| |
Then I updated the Site model to add the new description and theme_color columns to the $fillable array to ensure I could save them using the form.
| |
After that I was ready to update the form, so back to resources/views/dashboard.blade.php.

And the last part of this step was to run the migration so I could move on to the controller.
| |
After the migration succeeded I was ready to update the store login in SiteController so my new values could be stored in their respective columns.
| |
And finally I needed to include the description and the theme_color in the json output in Tenant\SiteController.
| |
And to prove to myself that it was working I created another new site called Joes Site.

Recap
I added the description and theme_color columns to the sites table and updated the Site model and the view for the form on the dashboard. then I ran the migration to apply the database changes and updated the SiteController to allow the new form inputs to be saved to the correct columns in the sites table and the Tenant\SiteController to ensure the page is dynamically rendering based on content in the database.
The commit for todays session is commit a7a1488.