Layout usage bewteen backend and frontend

  • Hi all,

    In my current project I do some action from the backend and/or the frontend.

    I need to share some layouts, however at this moment, I am stuck because the frontend and the backend don't use the same Theme.

    Themes/Adminlte for the admin
    Themes/XXXfor the frontend

    I am sending some email from the backend and the frontend, using the layout "mail.blade.php"

    I extends it via @extends('layouts.mail') which is either taking the Adminlte or the XXX theme

    The issue is that I have to duplicate this layout because the frontend and the backend are different theme

    One solution could be to create a symlink from one theme to the other, however I have to replicate this symlink on every environment.

    Is there a way to specify the Theme before I send the email ?

    Thank you

  • admin


    You can set the active theme in your controllers if you need to overwrite that. This will enable you to use a layout from a certain theme.

    You can do that using the Stylist class, $stylist->activate('Flatly');

  • Thanks I will try it asap, in the meantime I mark the question as resolved.

Log in to reply

Looks like your connection to AsgardCms was lost, please wait while we try to reconnect.