Download the PHP package gerardojbaez/vehicle without Composer

On this page you can find all versions of the php package gerardojbaez/vehicle. 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 vehicle

Vehicles Data for Laravel 5.2

This package allows you to work with vehicles makes, models, years and other details in Laravel 5.2.

Where the data come from?

The original list was collected from www.fueleconomy.gov. (They offer XML and CSV files). The list is updated and validated against some industry standards.

Content

Installation

Composer

Pull this package through Composer (file composer.json)

Run this command inside your terminal.

composer update

Service Provider

Add the package to your application service providers in config/app.php file.

Config File, Migration and Seeders

Publish package config file, migrations and seeders with the command:

php artisan vendor:publish

Then run migrations.

php artisan migrate

Then the vehicle seeder.

php artisan db:seed --class VehicleTablesSeeder

Traits and Contracts

When one of your models has make, model, model year and/or a vehicle you can add the required relations with the traits.

See the following example:

You do not need to use all traits if you do not need them. You can use only HasMake trait when only make is used for example.

Usage

The CSV file

All data is stored in a CSV file. This is done so it's easy to manage.

File structure:

Make Model Year cylinders displacement drive transmission class
Acura ILX 2017 4 2.4 Front-Wheel Drive 8-Speed Automated Manual Compact Cars

Update the CSV file

Export to the desired location:

php artisan vehicle:export "/path/to/exported/file.csv"

When you have done, run:

php artisan vehicle:generate "/path/to/exported/file.csv"
php artisan db:seed --class VehicleTablesSeeder

The vehicle:generate command will generate individual files containing its own data to be used with seeders.

Remember to migrate:refresh if you have prevously seeded the database!

Models

This package comes with Gerardojbaez\Vehicle\Models\VehicleMake, Gerardojbaez\Vehicle\Models\VehicleModel, Gerardojbaez\Vehicle\Models\VehicleModelYear and Gerardojbaez\Vehicle\Models\Vehicle models.

For more information please take a look at each model.

Controllers

It's more likely that you will want to retrieve makes, models and years from your frontend (via ajax for example); we have created these basic controllers for you: Gerardojbaez\Vehicle\Controllers\MakesController, Gerardojbaez\Vehicle\Controllers\ModelsController, Gerardojbaez\Vehicle\Controllers\ModelYearsController, Gerardojbaez\Vehicle\Controllers\VehicleController. You can use these directly or extends with your own.

Controllers returns a json reponse containing (if any) the requested data.

Routes

This is an example. You can structure these routes as you want.

License

This package is free software distributed under the terms of the MIT license.


All versions of vehicle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version ~5.0
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 gerardojbaez/vehicle contains the following files

Loading the files please wait ....