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.