While using Laravel Volt with Livewire, encountering a ParseError with the message syntax error, unexpected integer "1". The error occurs in the compiled views stored in the storage/framework/views folder. All project dependencies are up to date. The code causing the error is embedded in the generated view file 362bf8caa4c3264313ab66655990e3a0.php.
<?php
use Livewire\Volt\Actions;
use Livewire\Volt\CompileContext;
use Livewire\Volt\Contracts\Compiled;
use Livewire\Volt\Component;
new class extends Component implements Livewire\Volt\Contracts\FunctionalComponent
{
public static CompileContext $__context;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
public function mount()
{
(new Actions\InitializeState)->execute(static::$__context, $this, get_defined_vars());
(new Actions\CallHook('mount'))->execute(static::$__context, $this, get_defined_vars());
}
public function getListeners()
{
$arguments = [static::$__context, $this, func_get_args()];
return (new Actions\ResolveListeners)->execute(...$arguments);
}
public function 1Handler($id)
{
$arguments = [static::$__context, $this, func_get_args()];
return (new Actions\CallListener('1'))->execute(...$arguments);
}
};
View Code Causing Error
<?php
use function Livewire\Volt\{state};
use function Livewire\Volt\{on};
on('shipment-selected', function ($id) {
//...
});
?>
Steps To Reproduce
Create a Laravel Volt component as per the provided sample code.
Volt Version
1.1
Laravel Version
10.21.0
PHP Version
8.2.8
Database Driver & Version
No response
Description
While using Laravel Volt with Livewire, encountering a
ParseError
with the messagesyntax error, unexpected integer "1"
. The error occurs in the compiled views stored in thestorage/framework/views
folder. All project dependencies are up to date. The code causing the error is embedded in the generated view file362bf8caa4c3264313ab66655990e3a0.php
.Error Details
362bf8caa4c3264313ab66655990e3a0.php
file:View Code Causing Error
Steps To Reproduce