Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

azakir's avatar

php jquery plugin to laravel?

i am still strugling a bit with the style switcher but found something kind of usefull.

http://code.tutsplus.com/tutorials/how-to-create-an-amazing-jquery-style-switcher--net-532

but my question is in the above tutorial on a switcher he uses the following php code in style-switcher.php:

<?php
    $style = $_GET['style'];
    setcookie("style", $style, time()+604800); // 604800 = amount of seconds in one week
    if(isset($_GET['js'])) {
        echo $style;
    } else {
        header("Location: ".$_SERVER['HTTP_REFERER']);
    }
?>

he then uses to call the stylesheet change.

<li id="day"><a href="style-switcher.php?style=day">Day</a></li>

how could this be translated to laravel?

0 likes
0 replies

Please or to participate in this conversation.