local ls = require("luasnip") local s = ls.snippet local t = ls.text_node local i = ls.insert_node local f = ls.function_node local function psr_namespace(args, snip) local path = snip.env.TM_FILENAME_FULL or "" local root = "/src/" local ns = path:match(root .. "(.*)/[^/]+%.php$") if ns then return ns:gsub("/", "\\") else return "App" end end local function class_name(args, snip) local filename = snip.env.TM_FILENAME or "" return filename:match("([^%.]+)") or "ClassName" end return { s("du", { t("dump("), i(1), t(");") }), s("dt", { t("\\PhpStan\\dumpType("), i(1), t(");") }), s("ql", { t("\\Illuminate\\Support\\Facades\\DB::listen(function (\\Illuminate\\Database\\Events\\QueryExecuted $e) {"), t({"", " dump($e->sql, $e->bindings);"}), t({"", "});"}) }), s("test", { t("test("), i(1), t(", function () {"), t({"", " "}), i(2), t({"", ");"}) }), s("/**", { t("/**"), t({"", " * "}), i(1), t({"", " */"}) }), s("@p", { t("@property "), i(1), t(" $"), i(2) }), s("@pb", { t("@property bool $"), i(1) }), s("@ps", { t("@property string $"), i(1) }), s("@pi", { t("@property int $"), i(1) }), s("@pc", { t("@property \\Illuminate\\Support\\Collection $"), i(2) }), s("@pd", { t("@property \\Illuminate\\Support\\Carbon $"), i(1) }), s("@pp", { t("/**"), t({"", " * @property int $id"}), t({"", " * "}), i(1), t({"", " * @property \\Illuminate\\Support\\Carbon $created_at"}), t({"", " * @property \\Illuminate\\Support\\Carbon $updated_at"}), t({"", " *", " * Relationships"}), t({"", " * "}), i(2), t({"", " */"}) }), s("php", { t("