tighten / ziggy

Use your Laravel routes in JavaScript.
MIT License
3.83k stars 247 forks source link

This package does not work with Folio named routes #732

Closed ronald2wing closed 3 months ago

ronald2wing commented 5 months ago

Ziggy version

v2.0.5

Laravel version

v11.0.5

Description

This package does not retrieve the Folio routes.

Ziggy call and context

route('music-videos.show', {musicVideo: musicVideo.slug});

Ziggy configuration

{
    "url": "http://localhost",
    "port": null,
    "defaults": {},
    "routes": {
        "login": {
            "uri": "login",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "logout": {
            "uri": "logout",
            "methods": [
                "POST"
            ]
        },
        "password.request": {
            "uri": "forgot-password",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "password.reset": {
            "uri": "reset-password/{token}",
            "methods": [
                "GET",
                "HEAD"
            ],
            "parameters": [
                "token"
            ]
        },
        "password.email": {
            "uri": "forgot-password",
            "methods": [
                "POST"
            ]
        },
        "password.update": {
            "uri": "reset-password",
            "methods": [
                "POST"
            ]
        },
        "register": {
            "uri": "register",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "user-profile-information.update": {
            "uri": "user/profile-information",
            "methods": [
                "PUT"
            ]
        },
        "user-password.update": {
            "uri": "user/password",
            "methods": [
                "PUT"
            ]
        },
        "password.confirmation": {
            "uri": "user/confirmed-password-status",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "password.confirm": {
            "uri": "user/confirm-password",
            "methods": [
                "POST"
            ]
        },
        "two-factor.login": {
            "uri": "two-factor-challenge",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "two-factor.enable": {
            "uri": "user/two-factor-authentication",
            "methods": [
                "POST"
            ]
        },
        "two-factor.confirm": {
            "uri": "user/confirmed-two-factor-authentication",
            "methods": [
                "POST"
            ]
        },
        "two-factor.disable": {
            "uri": "user/two-factor-authentication",
            "methods": [
                "DELETE"
            ]
        },
        "two-factor.qr-code": {
            "uri": "user/two-factor-qr-code",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "two-factor.secret-key": {
            "uri": "user/two-factor-secret-key",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "two-factor.recovery-codes": {
            "uri": "user/two-factor-recovery-codes",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "profile.show": {
            "uri": "user/profile",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "sanctum.csrf-cookie": {
            "uri": "sanctum/csrf-cookie",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "livewire.update": {
            "uri": "livewire/update",
            "methods": [
                "POST"
            ]
        },
        "livewire.upload-file": {
            "uri": "livewire/upload-file",
            "methods": [
                "POST"
            ]
        },
        "livewire.preview-file": {
            "uri": "livewire/preview-file/{filename}",
            "methods": [
                "GET",
                "HEAD"
            ],
            "parameters": [
                "filename"
            ]
        },
        "ignition.healthCheck": {
            "uri": "_ignition/health-check",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "ignition.executeSolution": {
            "uri": "_ignition/execute-solution",
            "methods": [
                "POST"
            ]
        },
        "ignition.updateConfig": {
            "uri": "_ignition/update-config",
            "methods": [
                "POST"
            ]
        },
        "dashboard": {
            "uri": "dashboard",
            "methods": [
                "GET",
                "HEAD"
            ]
        },
        "laravel-folio": {
            "uri": "{fallbackPlaceholder}",
            "methods": [
                "GET",
                "HEAD"
            ],
            "wheres": {
                "fallbackPlaceholder": ".*"
            },
            "parameters": [
                "fallbackPlaceholder"
            ]
        }
    }
}

Route definition

<?php

use function Laravel\Folio\name;

name('music-videos.show');

?>
bakerkretzmar commented 5 months ago

Thanks! We'll support this asap.