PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Written By
Views

Laravel Cookies

Laravel Cookies

Using Cookies in Laravel is super easy. Take a look at how we can use cookies in Laravel below:

First, Set a cookie you can use the following code:

$ref = 'my cookie value';
return redirect('/')->withCookie('ref', $ref);

Second, get a cookie value by doing the following:

$cookie = $request->cookie('ref');

And it's as easy as that. To learn more about laravel cookies you can visit the official documentation.

Additionally you can learn more about Laravel cookies by checking out this video:

Comments (0)

loading comments