Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

integrate fontawesome in blade laravel

// In AppServiceProvider.php :
public function boot()
{
  Blade::directive('icon', fn ($expression) => "<i class="fas fa-{{ $expression }}"></i>");
}

// In the blade template:
<p>
  <span>@icon('user-plus')</span>
  <strong class="text-2xl">Create user</strong>
</p>
Source by www.yannpl.me #
 
PREVIOUS NEXT
Tagged: #integrate #fontawesome #blade #laravel
ADD COMMENT
Topic
Name
2+2 =