Learn how to efficiently search comma-separated values in Laravel using the FIND_IN_SET() function and whereRaw() method. Ideal for applications with multiple values in a single column.
In many applications, we store multiple values in a single database column, often as a comma-separated list. In this guide, we’ll show you how to efficiently search these comma-separated values in Laravel using the FIND_IN_SET() function with the whereRaw() method.
Why You Need This
Imagine you have two tables: posts and tags. In the posts table, the tag_id column stores multiple tag IDs separated by commas. For instance, a single post might be associated with several tags. We’ll demonstrate how to search for posts that include a specific tag ID.
Why You Need This
Normally, if you are not active for long time in your system then you will get this error.
To avoid TokenMismatchException error, we may add exceptions for the URLs that we don’t want to have CSRF protection. There are special array for that in app/Http/Middleware/VerifyCsrfToken.php
 class VerifyCsrfToken extends Middleware
  {
      /**
        * The URIs that should be excluded from CSRF verification.
        *
        * @var array
        */
      protected $except = [
          //
      ];
  }  
 So what we need do, just add logout into this array
 
  protected $except = [
  '/logout'
    ]; 
If you want to add more URLs then you can add here, but CSRF protection is also important.
For more detail you can write Laravel Documentation
You may also find interesting:
Effortlessly Log Out Users from Other Devices in Laravel 11 – Ultimate Guide
