Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 988 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 988 Bytes

Ziggy Routes Auto Generate

This Command Generate All Files In Routes Folder To Ziggy Json File And Make Auto Generate If Any Route Changed .

Installation

  • Open vite.config.js Then At The Top Of File Add
import { exec } from "node:child_process";
  • And At The End Of Plugins Add
{
    name: "ziggy",
    enforce: "post",
    handleHotUpdate({ server, file }) {
        if (file.includes("/routes/") && file.endsWith(".php")) {
            exec(
                "php artisan ziggy:generate",
                (error, stdout) =>
                    error === null &&
                    console.log(`Ziggy Routes Generated Successfully !`)
            );
        }
    },
},
  • Congratulations You Have Now Auto Generated For Routes Folder

Links