Skip to content

Commit d02db2b

Browse files
author
Alexandro Cocouvi
committed
Add Blade tip for the selected directive
1 parent fb28c23 commit d02db2b

1 file changed

Lines changed: 0 additions & 102 deletions

File tree

tips/views.md

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Views & Blade Tips ([cd ..](../README.md))
22

3-
# Views & Blade Tips ([cd ..](../README.md))
4-
53
- [Type Hinting for Blade](#laravel-tip--type-hinting-for-blade-️)
64
- [The "checked" Blade Directive](#laravel-tip--the-checked-blade-directive-️)
75
- [The "selected" Blade Directive](#laravel-tip--the-selected-blade-directive-️)
@@ -16,106 +14,6 @@
1614
- [The "forelse" Blade Directive](#laravel-tip--the-forelse-blade-directive-️)
1715
- [The "use" Blade Directive](#laravel-tip--the-use-blade-directive-️)
1816
- [Better If Statements in Blade](#laravel-tip--better-if-statements-in-blade-️)
19-
## Laravel Tip 💡: Type Hinting for Blade ([⬆️](#views--blade-tips-cd-))
20-
## Laravel Tip 💡: Type Hinting for Blade ([⬆️](#views--blade-tips-cd-))
21-
## Laravel Tip 💡: The "checked" Blade Directive ([⬆️](#views--blade-tips-cd-))
22-
## Laravel Tip 💡: The "checked" Blade Directive ([⬆️](#views--blade-tips-cd-))
23-
## Laravel Tip 💡: Access the Parent Loop Variable ([⬆️](#views--blade-tips-cd-))
24-
## Laravel Tip 💡: Access the Parent Loop Variable ([⬆️](#views--blade-tips-cd-))
25-
## Laravel Tip 💡: Short Attribute Syntax ([⬆️](#views--blade-tips-cd-))
26-
## Laravel Tip 💡: Short Attribute Syntax ([⬆️](#views--blade-tips-cd-))
27-
## Laravel Tip 💡: Blade To HTML ([⬆️](#views--blade-tips-cd-))
28-
## Laravel Tip 💡: Blade To HTML ([⬆️](#views--blade-tips-cd-))
29-
## Laravel Tip 💡: The "aware" Blade Directive ([⬆️](#views--blade-tips-cd-))
30-
## Laravel Tip 💡: The "aware" Blade Directive ([⬆️](#views--blade-tips-cd-))
31-
## Laravel Tip 💡: The "readonly" Blade Directive ([⬆️](#views--blade-tips-cd-))
32-
## Laravel Tip 💡: The "readonly" Blade Directive ([⬆️](#views--blade-tips-cd-))
33-
## Laravel Tip 💡: The "includeWhen" Blade Directive ([⬆️](#views--blade-tips-cd-))
34-
## Laravel Tip 💡: The "includeWhen" Blade Directive ([⬆️](#views--blade-tips-cd-))
35-
## Laravel Tip 💡: Render Inline Blade Templates ([⬆️](#views--blade-tips-cd-))
36-
## Laravel Tip 💡: Render Inline Blade Templates ([⬆️](#views--blade-tips-cd-))
37-
## Laravel Tip 💡: Useful Loop Properties ([⬆️](#views--blade-tips-cd-))
38-
## Laravel Tip 💡: Useful Loop Properties ([⬆️](#views--blade-tips-cd-))
39-
## Laravel Tip 💡: The "forelse" Blade Directive ([⬆️](#views--blade-tips-cd-))
40-
## Laravel Tip 💡: The "forelse" Blade Directive ([⬆️](#views--blade-tips-cd-))
41-
## Laravel Tip 💡: The "use" Blade Directive ([⬆️](#views--blade-tips-cd-))
42-
## Laravel Tip 💡: The "use" Blade Directive ([⬆️](#views--blade-tips-cd-))
43-
![Laravel](https://img.shields.io/badge/Laravel-%3E%3D10.35-FF2D20?style=for-the-badge&logo=laravel&logoColor=white)
44-
![Laravel](https://img.shields.io/badge/Laravel-%3E%3D10.35-FF2D20?style=for-the-badge&logo=laravel&logoColor=white)
45-
```php
46-
// Instead of this 🥱
47-
@php
48-
use \App\Enums\TaskResult;
49-
use \App\Enums\NotificationTypeEnum as NotificationType;
50-
@endphp
51-
52-
// You can do this 🔥
53-
@use('\App\Enums\TaskResult')
54-
@use('\App\Enums\NotificationTypeEnum', 'NotificationType')
55-
```
56-
```php
57-
// Instead of this 🥱
58-
@php
59-
use \App\Enums\TaskResult;
60-
use \App\Enums\NotificationTypeEnum as NotificationType;
61-
@endphp
62-
63-
// You can do this 🔥
64-
@use('\App\Enums\TaskResult')
65-
@use('\App\Enums\NotificationTypeEnum', 'NotificationType')
66-
```
67-
## Laravel Tip 💡: Better If Statements in Blade ([⬆️](#views--blade-tips-cd-))
68-
## Laravel Tip 💡: Better If Statements in Blade ([⬆️](#views--blade-tips-cd-))
69-
```html
70-
@auth
71-
{{-- Equivalent to @if(auth()->check()) --}}
72-
@endauth
73-
74-
@guest
75-
{{-- Equivalent to @if(auth()->guest()) --}}
76-
@endguest
77-
78-
@isset($record)
79-
{{-- Equivalent to @if(isset($record)) --}}
80-
@endisset
81-
82-
@empty($record)
83-
{{-- Equivalent to @if(empty($record)) --}}
84-
@endempty
85-
86-
@production
87-
{{-- Equivalent to @if(app()->isProduction()) --}}
88-
@endproduction
89-
90-
@env('local')
91-
{{-- Equivalent to @if(app()->environment('local')) --}}
92-
@endenv
93-
```
94-
```html
95-
@auth
96-
{{-- Equivalent to @if(auth()->check()) --}}
97-
@endauth
98-
99-
@guest
100-
{{-- Equivalent to @if(auth()->guest()) --}}
101-
@endguest
102-
103-
@isset($record)
104-
{{-- Equivalent to @if(isset($record)) --}}
105-
@endisset
106-
107-
@empty($record)
108-
{{-- Equivalent to @if(empty($record)) --}}
109-
@endempty
110-
111-
@production
112-
{{-- Equivalent to @if(app()->isProduction()) --}}
113-
@endproduction
114-
115-
@env('local')
116-
{{-- Equivalent to @if(app()->environment('local')) --}}
117-
@endenv
118-
```
11917

12018
## Laravel Tip 💡: Type Hinting for Blade ([⬆️](#views--blade-tips-cd-))
12119

0 commit comments

Comments
 (0)