Skip to content

The Blade "or" operator has been removed in favor of PHP's built-in ?? "null coalesce" operator, which has the same purpose and functionality #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions resources/views/table.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<table class="{{ $class or 'table' }}">
@if (App::VERSION() > 5.6)
<table class="{{ $class ?? 'table' }}">
@elseif (App::VERSION() <= 5.6)
<table class="{{ $class or 'table' }}">
@endif
@if(count($columns))
<thead>
<tr>
Expand Down Expand Up @@ -36,7 +40,11 @@
{!! $c->render($r) !!}
@else
{{-- Use the "rendered_foo" field, if available, else use the plain "foo" field --}}
{!! $r->{'rendered_' . $c->getField()} or $r->{$c->getField()} !!}
@if (App::VERSION() > 5.6)
{!! $r->{'rendered_' . $c->getField()} ?? $r->{$c->getField()} !!}
@elseif (App::VERSION() <= 5.6)
{!! $r->{'rendered_' . $c->getField()} or $r->{$c->getField()} !!}
@endif
@endif
</td>
@endforeach
Expand Down