Skip to content
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

[Formatting Bug]: Problem when I've this phrase in code {{ $post->metaData?->abstract }} #888

Open
taha-moghaddam opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@taha-moghaddam
Copy link

Platform

MacOS

Template before formatting

@extends('bblog::layouts.landing')
@section('title')
    {{ __('bblog::titles.Blog Posts List') }}
@endsection
@section('content')
    <div class="col-12 text-center mb-4">
        <span class="h2">{{ __('bblog::titles.Blog Posts List') }}</span>
    </div>
    <hr>
    @foreach ($posts as $post)
        <div class="col-sm-4 mb-3 post-item">
            <a class="card-img-top" href="{{ route('bblog.blog.show', $post) }}">
                <img src="{{ $post->image }}" class="card-img-top cursor-pinter" alt="{{ $post->title }}">
            </a>
            <div class="card border-0 shadow-sm p-3 mb-5 bg-body rounded">
                <div class="card-body">
                    <a class="text-dark text-decoration-none" href="{{ route('bblog.blog.show', $post) }}">
                        <h2 class="card-title">
                            {{ $post->title }}
                        </h2>
                    </a>
                    <p class="card-text">
                        {{ $post->metaData?->abstract }}
                    </p>
                    <div class="footer d-flex justify-content-between align-items-center">
                        <sub dir="ltr">{{ jalali($post->created_at)->format('%B %d، %Y H:i') }}</sub>
                        <a class="btn btn-info text-white" href="{{ route('bblog.blog.show', $post) }}">
                            {{ __('bblog::buttons.Continue') }}...
                        </a>
                    </div>
                </div>
            </div>
        </div>
    @endforeach
    {!! $posts->links() !!}
@endsection

Template after formatting

@extends('bblog::layouts.landing')
@section('title')
    {{ __('bblog::titles.Blog Posts List') }}
@endsection
@section('content')
    <div class="col-12 text-center mb-4">
        <span class="h2">{{ __('bblog::titles.Blog Posts List') }}</span>
    </div>
    <hr>
    @foreach ($posts as $post)
        <div class="col-sm-4 mb-3 post-item">
            <a class="card-img-top" href="{{ route('bblog.blog.show', $post) }}">
                <img src="{{ $post->image }}" class="card-img-top cursor-pinter" alt="{{ $post->title }}">
            </a>
            <div class="card border-0 shadow-sm p-3 mb-5 bg-body rounded">
                <div class="card-body">
                    <a class="text-dark text-decoration-none" href="{{ route('bblog.blog.show', $post) }}">
                        <h2 class="card-title">
                            {{ $post->title }}
                        </h2>
                    </a>
                    <p class="card-text">
                        {{ $post->metaData?->abstract }}
                    </p>
                    <div class="footer d-flex justify-content-between align-items-center">
                        <sub dir="ltr">{{ jalali($post->created_at)->format('%B %d، %Y H:i') }}</sub>
                        <a class="btn btn-info text-white" href="{{ route('bblog.blog.show', $post) }}">
                            {{ __('bblog::buttons.Continue') }}...
                        </a>
                    </div>
                </div>
            </div>
        </div>
    @endforeach
    {!! $posts->links() !!}
@endsection

Expected Behaviour

I get this error which will fix after removing phrase {{ $post->metaData?->abstract }}:

Parse Error : syntax error, unexpected 'abstract' (T_ABSTRACT) on line 1 > 1 | <?php echo $post->metaData?->abstract ?> | ^

Relevant log output

Parse Error : syntax error, unexpected 'abstract' (T_ABSTRACT) on line 1 > 1 | <?php echo $post->metaData?->abstract ?> | ^
@taha-moghaddam taha-moghaddam added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants