Support the ongoing development of Laravel.io →
Database Views Blade
Last updated 2 years ago.
0

Is the template going to be the same but with user data involved? Or, are different users going to have different components? Either way, I would have a single template with variables loaded from the database based on Auth::user(). From there if they user lets say wanted a clock widget on their template have an entry in the database that would make it as true and have an @if statement. That's how I would go about it. Maybe yours is a bit more complex.

Last updated 2 years ago.
0

Well, imagine there are 2 users with 2 database- User A with DB-A, User B with DB-B.

Lets say the index page with 2 different template

User A template:

<html>
<body>
   <div>
       Template for User A {{$userAVariable}}
   </div>
</body>
</html>

User A template:

<html>
<body>
   <div>
       Template for User B {{$userBVariable}}
   </div>
</body>
</html>

Both template will be stored in their own database, lets say a table named "Template"

When render the page, template will be fetch from DB and render it.

Hope this clear about my question.

Thanks

Last updated 2 years ago.
0

I don't think that that is possible, you can look at Twig, that should be possible. See https://github.com/rcrowe/TwigBridge/tree/0.6 and http://twig.sensiolabs.org/doc/functions/template_from_string.html

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ming517 ming517 Joined 19 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.