Skip to content

Commit 8bbf329

Browse files
committed
laravel 6 support
1 parent 679bb9b commit 8bbf329

22 files changed

+223
-108
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `LaravelSurveyJs` will be documented in this file.
44

5+
## Version 1.0.0
6+
7+
### Changes
8+
- Added Laravel 6.* support
9+
10+
511
## Version 0.3.0
612

713
### Changes

composer.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,52 @@
11
{
2-
"name": "aidynmakhataev/laravelsurveyjs",
3-
"description": "Laravel wrapper for surveyjs library",
2+
"name": "fruitware/laravel-surveyjs",
3+
"version": "1.0.0",
4+
"description": "Up-to-date Laravel wrapper for surveyjs library",
45
"license": "MIT",
56
"authors": [
7+
{
8+
"name": "Serge Beresnev",
9+
"email": "serge@fruitware.ry",
10+
"homepage": "https://github.com/keriat"
11+
},
612
{
713
"name": "Aidyn Makhataev",
814
"email": "makataev.7@gmail.com",
915
"homepage": "https://github.com/AidynMakhataev"
1016
}
1117
],
12-
"homepage": "https://github.com/aidynmakhataev/laravelsurveyjs",
18+
"homepage": "https://github.com/Fruitware/laravel-surveyjs",
1319
"keywords": [
14-
"Laravel", "LaravelSurveyJs", "surveyjs", "survey manager", "laravel survey", "survey editor", "surveyjs builder", "aidynmakhataev"
20+
"Laravel", "LaravelSurveyJs", "surveyjs", "survey manager", "laravel survey", "survey editor", "surveyjs builder", "fruitware"
1521
],
1622
"require": {
17-
"illuminate/support": "~5",
18-
"cviebrock/eloquent-sluggable": "^4.0"
23+
"php": "^7.2",
24+
"cviebrock/eloquent-sluggable": "*",
25+
"illuminate/database": "6.1.*",
26+
"ext-json": "*"
1927
},
2028
"require-dev": {
2129
"phpunit/phpunit": "~6.0",
22-
"orchestra/testbench": "~3.0"
30+
"orchestra/testbench": "*"
2331
},
2432
"autoload": {
2533
"psr-4": {
26-
"AidynMakhataev\\LaravelSurveyJs\\": "src/"
34+
"Fruitware\\LaravelSurveyJS\\": "src/"
2735
}
2836
},
2937
"autoload-dev": {
3038
"psr-4": {
31-
"AidynMakhataev\\LaravelSurveyJs\\Tests\\": "tests"
39+
"Fruitware\\LaravelSurveyJS\\Tests\\": "tests"
3240
}
3341
},
3442
"extra": {
3543
"laravel": {
3644
"providers": [
37-
"AidynMakhataev\\LaravelSurveyJs\\LaravelSurveyJsServiceProvider"
45+
"Fruitware\\LaravelSurveyJS\\LaravelSurveyJsServiceProvider"
3846
],
3947
"aliases": {
40-
"LaravelSurveyJs": "AidynMakhataev\\LaravelSurveyJs\\Facades\\LaravelSurveyJs"
48+
"LaravelSurveyJs": "Fruitware\\LaravelSurveyJS\\Facades\\LaravelSurveyJs"
4149
}
4250
}
4351
}
44-
}
52+
}

config/survey-manager.php

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
*/
1010

1111
// The prefix used in all base routes
12-
'route_prefix' => 'survey',
12+
'route_prefix' => 'survey',
1313

1414
// The prefix used in api endpoints
15-
'api_prefix' => 'api',
15+
'api_prefix' => 'api',
1616

1717
// The prefix used in admin route
18-
'admin_prefix' => 'admin',
18+
'admin_prefix' => 'admin',
1919

2020
/*
2121
|--------------------------------------------------------------------------
@@ -24,13 +24,13 @@
2424
*/
2525

2626
// route middleware
27-
'route_middleware' => ['web'],
27+
'route_middleware' => ['web'],
2828

2929
// api middleware
30-
'api_middleware' => ['api'],
30+
'api_middleware' => ['api'],
3131

3232
// admin middleware
33-
'admin_middleware' => ['web'],
33+
'admin_middleware' => ['web'],
3434

3535
/*
3636
|--------------------------------------------------------------------------
@@ -39,16 +39,16 @@
3939
*/
4040

4141
// Pagination in admin section
42-
'pagination_perPage' => 12,
42+
'pagination_perPage' => 12,
4343

4444
// User model
45-
'user_model' => 'App\User',
45+
'user_model' => 'App\User',
4646

4747
// Default locale for survey
48-
'locale' => 'en',
48+
'locale' => 'en',
4949

5050
// Default theme for survey
51-
'theme' => 'darkblue',
51+
'theme' => 'darkblue',
5252

5353
/*
5454
|--------------------------------------------------------------------------
@@ -57,54 +57,68 @@
5757
|--------------------------------------------------------------------------
5858
*/
5959

60-
'builder' => [
60+
'builder' => [
6161

62-
'theme' => 'darkblue',
62+
'theme' => 'darkblue',
6363

64-
'showEmbededSurveyTab' => false,
64+
'showEmbededSurveyTab' => false,
6565

66-
'showJSONEditorTab' => false,
66+
'showJSONEditorTab' => false,
6767

68-
'showTestSurveyTab' => true,
68+
'showTestSurveyTab' => true,
6969

70-
'showPropertyGrid' => true,
70+
'showPropertyGrid' => true,
7171

72-
'showOptions' => false,
72+
'showOptions' => false,
7373

74-
'showState' => false,
74+
'showState' => false,
7575

76-
'haveCommercialLicense' => false,
76+
'haveCommercialLicense' => false,
7777
],
7878

7979
/*
8080
|--------------------------------------------------------------------------
8181
| SurveyJS Custom Widgets
8282
|--------------------------------------------------------------------------
8383
*/
84-
'widgets' => [
84+
'widgets' => [
8585

86-
'icheck' => false,
86+
'icheck' => false,
8787

88-
'select2' => false,
88+
'select2' => false,
8989

90-
'inputmask' => false,
90+
'inputmask' => false,
9191

92-
'jquerybarrating' => false,
92+
'jquerybarrating' => false,
9393

94-
'jqueryuidatepicker' => false,
94+
'jqueryuidatepicker' => false,
9595

96-
'nouislider' => false,
96+
'nouislider' => false,
9797

98-
'select2tagbox' => false,
98+
'select2tagbox' => false,
9999

100-
'signaturepad' => false,
100+
'signaturepad' => false,
101101

102-
'sortablejs' => false,
102+
'sortablejs' => false,
103103

104-
'ckeditor' => false,
104+
'ckeditor' => false,
105105

106-
'autocomplete' => false,
106+
'autocomplete' => false,
107107

108-
'bootstrapslider' => false,
108+
'bootstrapslider' => false,
109+
],
110+
111+
/*
112+
* Database related configurations.
113+
*/
114+
'database' => [
115+
/*
116+
* Name of the tables created by the migrations
117+
* and used by the models of this package.
118+
*/
119+
'tables' => [
120+
'surveys' => 'surveyjs_surveys',
121+
'survey_results' => 'surveyjs_survey_results',
122+
],
109123
],
110124
];

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Contributions are accepted via Pull Requests on [Github](https://github.com/aidy
77
# TODO
88
If you want to contribute but do not know where to start, this list provides some starting points.
99

10+
— Add supporting for Laravel < 5.5
1011
- Add theme support
1112
- Add analytics and reports for survey results
12-
- Add supporting for Laravel < 5.5
1313
- Localization for Survey Builder
1414
- Set up TravisCI, StyleCI, ScrutinizerCI
1515
- Write a comprehensive ReadMe

database/migrations/2018_02_21_000001_create_surveys_table.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7+
/**
8+
* Class CreateSurveysTable
9+
*/
710
class CreateSurveysTable extends Migration
811
{
912
/**
@@ -13,7 +16,7 @@ class CreateSurveysTable extends Migration
1316
*/
1417
public function up()
1518
{
16-
Schema::create('surveys', function (Blueprint $table) {
19+
Schema::create(config('survey.database.tables.surveys'), function (Blueprint $table) {
1720
$table->increments('id');
1821
$table->string('name');
1922
$table->string('slug');
@@ -30,6 +33,6 @@ public function up()
3033
*/
3134
public function down()
3235
{
33-
Schema::dropIfExists('surveys');
36+
Schema::dropIfExists(config('survey.database.tables.surveys'));
3437
}
3538
}

database/migrations/2018_05_25_053226_create_survey_results_table.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7+
/**
8+
* Class CreateSurveyResultsTable
9+
*/
710
class CreateSurveyResultsTable extends Migration
811
{
912
/**
@@ -13,7 +16,7 @@ class CreateSurveyResultsTable extends Migration
1316
*/
1417
public function up()
1518
{
16-
Schema::create('survey_results', function (Blueprint $table) {
19+
Schema::create(config('survey.database.tables.survey_results'), function (Blueprint $table) {
1720
$table->increments('id');
1821
$table->unsignedInteger('survey_id');
1922
$table->unsignedInteger('user_id')->nullable();
@@ -30,6 +33,6 @@ public function up()
3033
*/
3134
public function down()
3235
{
33-
Schema::dropIfExists('survey_results');
36+
Schema::dropIfExists(config('survey.database.tables.survey_results'));
3437
}
3538
}

license.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The license
22

3-
Copyright (c) Aidyn Makhataev <makataev.7@gmail.com>
3+
Copyright for updated version (c) Fruitware <open-source@fruitware>
4+
initial creation (c) Aidyn Makhataev <makataev.7@gmail.com>
45

5-
...Add your license text here...
6+
...Licence text coming soon...

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LaravelSurveyJs
1+
# Laravel 6.* SurveyJs package
22

33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Total Downloads][ico-downloads]][link-downloads]
@@ -18,7 +18,7 @@ $ composer require aidynmakhataev/laravelsurveyjs
1818
2) Publish the config file & run the migrations
1919

2020
```bash
21-
php artisan vendor:publish --provider="AidynMakhataev\LaravelSurveyJs\LaravelSurveyJsServiceProvider"
21+
php artisan vendor:publish --provider="Fruitware\LaravelSurveyJS\LaravelSurveyJsServiceProvider"
2222
php artisan migrate
2323
```
2424

src/app/Http/Controllers/API/SurveyAPIController.php renamed to src/LaravelSurveyJS/Http/Controllers/API/SurveyAPIController.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?php
22

3-
namespace AidynMakhataev\LaravelSurveyJs\app\Http\Controllers\API;
3+
namespace Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Controllers\API;
44

55
use Illuminate\Routing\Controller;
6-
use AidynMakhataev\LaravelSurveyJs\app\Models\Survey;
7-
use AidynMakhataev\LaravelSurveyJs\app\Http\Resources\SurveyResource;
8-
use AidynMakhataev\LaravelSurveyJs\app\Http\Requests\CreateSurveyRequest;
9-
use AidynMakhataev\LaravelSurveyJs\app\Http\Requests\UpdateSurveyRequest;
10-
6+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Models\Survey;
7+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Resources\SurveyResource;
8+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Requests\CreateSurveyRequest;
9+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Requests\UpdateSurveyRequest;
10+
11+
/**
12+
* Class SurveyAPIController
13+
*
14+
* @package Fruitware/LaravelSurveyJS
15+
*/
1116
class SurveyAPIController extends Controller
1217
{
1318
public function index()

src/app/Http/Controllers/API/SurveyResultAPIController.php renamed to src/LaravelSurveyJS/Http/Controllers/API/SurveyResultAPIController.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?php
22

3-
namespace AidynMakhataev\LaravelSurveyJs\app\Http\Controllers\API;
3+
namespace Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Controllers\API;
44

55
use Illuminate\Http\Request;
66
use Illuminate\Routing\Controller;
7-
use AidynMakhataev\LaravelSurveyJs\app\Models\Survey;
8-
use AidynMakhataev\LaravelSurveyJs\app\Http\Resources\SurveyResource;
9-
use AidynMakhataev\LaravelSurveyJs\app\Http\Resources\SurveyResultResource;
7+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Models\Survey;
8+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Resources\SurveyResource;
9+
use Fruitware\LaravelSurveyJS\LaravelSurveyJS\Http\Resources\SurveyResultResource;
1010

11+
/**
12+
* Class SurveyResultAPIController
13+
*
14+
* @package Fruitware/LaravelSurveyJS
15+
*/
1116
class SurveyResultAPIController extends Controller
1217
{
1318
public function index(Survey $survey)

0 commit comments

Comments
 (0)