Get "PHP 8 in a Nuthshell" (Now with PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

The @use directive to import PHP classes in Blade templates

@use('App\Enums\WidgetStatusEnum', 'Status')

@use('App\Models\Bar')

{{ Status::Foo }}

{{ Bar::first() }}

Was that useful? Consider leaving a

Tip

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?