usanzadunje/artisan-vue

Multiple templates for your Vue application resources.

v1.1 2022-02-13 15:51 UTC

README

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

Multiple templates for your Vue application resources.

Generates components, views, composables(hooks), services and Vuex modules. All paths are easily configurable using config file.

Installation

You can install the package via composer:

composer require usanzadunje/artisan-vue

You can publish the config file with:

php artisan vendor:publish --tag="artisan-vue-config"

This is the contents of the published config file:

return [
    // Root directory where your Vue app lives
    'vue_root_dir' => resource_path("js"),

    // Name of the folder which stores views
    'views_dir' => 'views',

    // Name of the folder which stores components
    'components_dir' => 'components',

    // Name of the folder which stores composables(hooks)
    'composables_dir' => 'composables',

    // Path to the folder which stores Vuex modules
    'vuex-modules_dir' => 'store/modules',

    // Name of the folder which stores services
    'services_dir' => 'services',
];

Usage

# Generates template for specific resource
php artisan vue:make {resource} {path}

# Path can be file name(without extension) or path to the file along with its name
# Examples: 

# 1. generates Test.vue in your components directory
php artisan vue:make component Test 

# 2. generates testing folder as well as Test.vue file inside your component directory
php artisan vue:make component testing/Test 

# Lists all resources available for creation
php artisan vue:list

Command will take root of your Vue application (which you can specify in config file) append resource folder name (also in config file) and then try and create following:

  • All directories you provided in path if they do not exist
  • File itself (last portion of the path is considered file name) with appropriate extension for that resource

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.