Download the PHP package lummy/laravel-vue-api-crud-generator without Composer

On this page you can find all versions of the php package lummy/laravel-vue-api-crud-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-vue-api-crud-generator

Laravel Vue API Crud Generator

Overview

A Laravel package that lets you generate boilerplate code for a Vue.js/Laravel app. Simply enter the name of a database table and based on that it will create:

This package aims to speed up the process of communicating between backend (Laravel) and frontend (Vue.js).

Installation

composer require lummy/laravel-vue-api-crud-generator

Usage

Firstly you should create a new migration in the same way that you usually would. For example if creating a posts table use the command

php artisan make:migration create_posts_table

Then in your migration file add your fields as usual

Then run the migrate command to create the posts table

php artisan migrate

Once you have done that you just need to run one vueapi command. Add the name of your table to the end of the command so in this case it's posts.

php artisan vueapi:generate posts

This will then generate all the files mentioned above.

Once you have run this command, using the posts example above, it will create the following boilerplate files:

Routes

Based on a posts DB table it will produce these routes

Controller

Based on a posts DB table it will produce this controller

Model

Based on a posts DB table it will produce this model

Vue (List template)

Based on a posts DB table it will produce this Vue.js list single file component (Posts-list.vue)

Vue (Single template)

Based on a posts DB table it will produce this Vue.js single file component (Posts-single.vue)

Configuration

Here are the configuration settings with their default values.

To copy the config file to your working Laravel project enter the following artisan command

php artisan vendor:publish --provider="lummy\vueApi\vueApiServiceProvider" --tag="config"

model_dir

Specifies the location where the generated model files should be stored

controller_dir

Specifies the location where the generated controller files should be stored

vue_files_dir

Specifies the location where the Vue single file templates should be stored

vue_url_prefix

Specifies what prefix should be added to the URL in your view files. The default is /api ie /api/posts

routes_dir

Specifies the location of the routes directory

routes_file

Specifies the name of the routes file

Customising the templates

If you use another frontend framework such as React or you want to adjust the structure of the templates then you can customise the templates by publishing them to your working Laravel project

`php artisan vendor:publish --provider="lummy\vueApi\vueApiServiceProvider" --tag="templates"``

They will then appear in

\resources\views\vendor\vueApi

Variables in the templates

Each template file passes a data array with the following fields

$data['singular']

The singular name for the DB table eg Post

$data['plural']

The plural name for the DB table eg Posts

$data['singular_lower']

The singular name for the DB table (lowercase) eg post

$data['plural_lower']

The plural name for the DB table eg (lowercase) eg posts

$data['fields']

An array of the fields that are part of the model.

Other things to note

I have only tested this on Laravel MYSQL driver so I'm not sure if it will work on other databases.

In Vue.js files the routes are presumed to be: using the posts example. You can easily configure these from the templates generated

/posts (Posts-list.vue) /posts/{id} (Posts-single.vue)

Please feel free to contact me with any feedback or suggestions https://github.com/aarondo


All versions of laravel-vue-api-crud-generator with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lummy/laravel-vue-api-crud-generator contains the following files

Loading the files please wait ....