tighten / ziggy

Use your Laravel routes in JavaScript.
MIT License
3.91k stars 248 forks source link

prints the content of config/ziggy.php with php artisan command and on page load #624

Closed kashif-ghafoor closed 1 year ago

kashif-ghafoor commented 1 year ago

Ziggy version

v1.5

Laravel version

v8.69.0

Description

when I added basic filtering to ziggy config file. it started printing the content of config/ziggy.php to terminal with every php artisan command and when I load the page of which js file I am using route method I see the content of zigg file and then the actual page is rendered. there is no information on readme about this.

image

Ziggy call and context

fetch((route('admin.businesses.update',{
        business
    })),{
        method: 'POST',
        body: formData
    }).then(console.log('success'))

Ziggy configuration

return [
    'only' => ['admin.businesses.update', 'admin.businesses.edit'],
];

Route definition

Route::get('/admin/businesses/edit/{business}', 'AdminController@businessesEdit')->name('admin.businesses.edit');
Route::patch('/admin/businesses/{business}', 'BusinessController@update')->name('admin.businesses.update');
bakerkretzmar commented 1 year ago

Add an opening <?php to your config/ziggy.php file.