定制 mahmoud-mhamed/inertia-vue-helpers 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mahmoud-mhamed/inertia-vue-helpers

最新稳定版本:0.0.7

Composer 安装命令:

composer require mahmoud-mhamed/inertia-vue-helpers

包简介

This is my package inertia-vue-helpers

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require mahmoud-mhamed/inertia-vue-helpers

Before Use Any Command

must add \Mahmoudmhamed\InertiaVueHelpers\Providers\PackageServiceProvider::class to config=>app->providers array

Before Use Any Command

for laravel < 11

must add to config -> app -> providers array
  \Mahmoudmhamed\InertiaVueHelpers\Providers\PackageServiceProvider::class

for laravel >= 11

must add to config -> app.php
  'providers' => ServiceProvider::defaultProviders()->merge([
        \Mahmoudmhamed\InertiaVueHelpers\Providers\PackageServiceProvider::class,
    ])->toArray()

to force publish any file add --force to command

Publish Command To Clone Enums From app => Enums To resources => js => enum.js:

php artisan vendor:publish --tag="clone-enums-to-js-command"

Publish Command To Clone Lang Folder from php To resources => js => lang:

php artisan vendor:publish --tag="clone-lang-to-js-command"

Publish Command To Clone Abilities from app => classes => Abilities.php To resources => js => ability.js:

php artisan vendor:publish --tag="copy-ability-to-js-command"

Publish Vue Ability directive

php artisan vendor:publish --tag="ability-directive"

add to app.js

import {ability_if,ability_else} from "@/directive/AbilityDirective";

.directive('ability', ability_if)

.directive('else-ability', ability_else)

You Can Run Command From package.json by add to scripts

{
    ....
    "scripts": {
        "run-all": "php artisan lang:copy && php artisan ability:clone && php artisan enums:clone-to-js",
        "copy-lang": "php artisan lang:copy",
        "copy-ability": "php artisan ability:clone",
        "copy-enum": "php artisan enums:clone-to-js",
        "dev": "vite",
        "build": "vite build"
    },
    ...
}

To allow auto generate file if use vite.config.js in plugins array add

    plugins: [
    ....
    {
        name: "enum_clone",
        enforce: "post",
        handleHotUpdate({ server, file }) {
            if (file.includes("/app/Enums")) {
                exec(
                    "php artisan enums:clone-to-js",
                    (error, stdout) =>
                        error === null &&
                        console.log(`Enum Js File Generated Successfully !`)
                );
            }
        },
    },
   {
    name: "lang",
    enforce: "post",
    handleHotUpdate({ server, file }) {
        if (file.includes("/lang/")) {
            exec(
                `php artisan lang:copy --lang=${file.includes('/ar/')?'ar':'en'} --file=${file.split('/').pop()}`,
                (error, stdout) =>
                    error === null &&
                    console.log(`Lang Generated Successfully !`)
            );
        }
    },
},
    {
        name: "ability",
        enforce: "post",
        handleHotUpdate({ server, file }) {
            if (file.includes("/Abilities.php")) {
                exec(
                    "php artisan ability:clone",
                    (error, stdout) =>
                        error === null &&
                        console.log(`Ability Clone Successfully !`)
                );
            }
        },
    },
],

publish vue commponets to path resources/js/Components

php artisan vendor:publish --tag="ElTextComponent"
php artisan vendor:publish --tag="ElButtonComponent"
php artisan vendor:publish --tag="ElFormComponents"
Tag publish file description
ElTextComponent Text/ElText.vue
ElButtonComponent Buttons/ ElPrimaryButton.vue,ElSecondaryButton.vue,ElSubmitButton.vue
/ElLoadingDots.vue

publish make chart js or apex chart

npm i chart.js
npm i chartjs-plugin-datalabels

npm install --save apexcharts
npm install --save vue3-apexcharts

php artisan vendor:publish --tag="Chart"

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 635
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-27