syntax error, unexpected ';', expecting ',' or ')'

Posted 2 months ago by iboosensei

Hello, I'm trying to make a from with Blade component. But I get this error.

syntax error, unexpected ';', expecting ',' or ')' (View: C:\laragon\www\larabiz7\resources\views\editlisting.blade.php)

Here is my routes

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::resource('listings', 'ListingsController');

Route::post('/listings', [
    'as' => 'listings', 
    'uses' => '[email protected]'
  ]);

  Route::post('/listings/{listing}', [
    'as' => 'updatelisting', 
    'uses' => '[email protected]'
  ]);

//Route::post('/listings', '[email protected]');

Route::get('/dashboard', '[email protected]');

And my form


@extends('layouts.app')

@section('content')
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">Edit listing</div>

                    <div class="card-body">
                        @if (session('status'))
                            <div class="alert alert-success" role="alert">
                                {{ session('status') }}
                            </div>
                        @endif

                        <form action="{{route('updatelisting', $listing->id}}" method="POST">
                            @csrf

                            @component('components.form.input', [
                                'name' => 'name',
                                'label' => 'name',
                                'class' => 'form-control',
                                'placeholder' => 'Company name',
                                'value' => '{{$listing->name}}',
                            ])@endcomponent
                            
                            @component('components.form.input', [
                                'name' => 'website',
                                'label' => 'website',
                                'class' => 'form-control',
                                'placeholder' => 'Company website',
                                'value' => '{{$listing->website}}',
                            ])@endcomponent

                            @component('components.form.input', [
                                'name' => 'email',
                                'type' => 'email',
                                'label' => 'E-Mail Address',
                                'class' => 'form-control',
                                'placeholder' => 'Contact Mail',
                                'value' => '{{$listing->email}}',
                            ])@endcomponent

                            @component('components.form.input', [
                                'name' => 'phone',
                                'label' => 'phone',
                                'class' => 'form-control',
                                'placeholder' => 'Contact Phone',
                                'value' => '{{$listing->phone}}',
                            ])@endcomponent
                                
                            @component('components.form.input', [
                                'name' => 'address',
                                'label' => 'Address',
                                'class' => 'form-control',
                                'placeholder' => 'Business Address',
                                'value' => '{{$listing->address}}',
                            ])@endcomponent

                            @component('components.form.textarea', [
                                'name' => 'bio',
                                'label' => 'bio',
                                'content' => '',
                                'class' => 'form-control',
                                'placeholder' => 'About this business',
                                'value' => '{{$listing->bio}}',
                            ])@endcomponent
                                
                            @component('components.form.input', [
                                'name' => 'submit',
                                'type' => 'submit',
                                'value' => 'submit',
                                'class' => 'btn btn-primary',
                            ])@endcomponent

                            @component('components.form.input', [
                                'name' => '_method',
                                'type' => 'hidden',
                                'value' => 'PUT',
                            ])@endcomponent

                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel-body">
            
        </div>
@endsection

Can someone help me ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.