Download the PHP package jangraviren/laravel-survey without Composer
On this page you can find all versions of the php package jangraviren/laravel-survey. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jangraviren/laravel-survey
More information about jangraviren/laravel-survey
Files in jangraviren/laravel-survey
Package laravel-survey
Short Description Original credits goes to mceaser/laravel-survey.
License MIT
Homepage https://github.com/jangraviren/laravel-survey
Informations about the package laravel-survey
Original Credits
Goes to mceaser/laravel-survey
Just made this package to use in 5.7.* version.
Add question to your Laravel application
- Installation
- Usage
- Extending
This package allows you to add a survey to your Laravel application
Once installed you can do stuff like this:
Installation
- Laravel
- Lumen
Laravel
This package can be used in Laravel 5.4 or higher. If you are using an older version of Laravel You can install the package via composer:
In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php
file:
You can publish the migration with:
After the migration has been published you can create the category-, question- and answer-tables by running the migrations:
You can publish the config file with:
When published, the config/survey.php
config file contains:
Lumen
Lumen support is not tested!
You can install the package via Composer:
Copy the required files:
Now, run your migrations:
Then, register the configuration and the service provider:
Usage
The models supplied by this package can be used the same as any other model you make.
Extending
If you need to EXTEND the existing models note that:
- Your
Category
model needs to extend theJangraViren\Survey\Models\Category
model - Your
Question
model needs to extend theJangraViren\Survey\Models\Question
model - Your
Answer
model needs to extend theJangraViren\Survey\Models\Answer
model
If you need to REPLACE the existing models you need to keep the following things in mind:
- Your
Category
model needs to implement theJangraViren\Survey\Contracts\Category
contract - Your
Question
model needs to implement theJangraViren\Survey\Contracts\Question
contract - Your
Answer
model needs to implement theJangraViren\Survey\Contracts\Answer
contract
In BOTH cases, whether extending or replacing, you will need to specify your new models in the configuration. To do this you must update the models.categorie
, models.question
and models.answer
values in the configuration file after publishing the configuration with this command:
Testing
Credits
- Virender Jangra
- All Contributors
License
The MIT License (MIT). Please see License File for more information.