Skip to content

Comments

[9.x] Adds compilePushIf and compileEndpushIf functions#42762

Merged
taylorotwell merged 2 commits intolaravel:9.xfrom
mahmoudmohamedramadan:9.x
Jun 15, 2022
Merged

[9.x] Adds compilePushIf and compileEndpushIf functions#42762
taylorotwell merged 2 commits intolaravel:9.xfrom
mahmoudmohamedramadan:9.x

Conversation

@mahmoudmohamedramadan
Copy link
Contributor

Sometimes we need to check about something to push the script, instead of using the if directive we can use this directive, for illuminate see the next example:

Old version

@if (true==false)
@push('scripts')
<script>
    console.log('Push');
</script>
@endpush
@endif

New version

@pushIf(true==false, 'scripts')
<script>
    console.log('Push If');
</script>
@endPushIf

@GrahamCampbell GrahamCampbell changed the title Adds compilePushIf and compileEndpushIf functions [9.x] Adds compilePushIf and compileEndpushIf functions Jun 11, 2022
@taylorotwell taylorotwell merged commit c957aac into laravel:9.x Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants