Posts

Showing posts from September, 2024

VS code shortcut

Wrap with div  In VS Code, you can wrap content with a div using the Emmet abbreviation. Here’s the shortcut to achieve that: Highlight the content you want to wrap. Press Ctrl + Shift + P (or Cmd + Shift + P on Mac) to open the Command Palette. Type Emmet: Wrap with Abbreviation and select it. In the input field that appears, type div and press Enter . This will wrap the selected content with a <div> tag.

Spatie User Roles

use Spatie\Permission\Traits\ HasRoles ;   This is the trait need to use syncRole  hasRole    Usage: $user = JwtAuth :: user ();         if ( $user -> hasRole ( 'manager' )) {             $user -> syncRoles ([]);         }         $user -> assignRole ( 'user' );