Skip to content

Commit be0c965

Browse files
authored
Laravel 5.8 (#68)
* Preparing the project to a modularized way * Fix space and identation with phpcbf * Adding Factory and Seeders for Modules * Added Modules Seeders * Added new phpunit test configuration * Added Badge module * Added spatie/laravel-webhook-server package * Change PHP version supported in the project * Set php7.2 as the minimum version * Does not install codeclimate/php-test-reporter during the travis stup * Deactive test-reporter for a moment * Added phpunit-result-printer package
1 parent c540660 commit be0c965

File tree

187 files changed

+3180
-2245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+3180
-2245
lines changed

.editorconfig

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
root = true
22

33
[*]
4-
indent_style = space
5-
indent_size = 2
6-
end_of_line = lf
74
charset = utf-8
8-
trim_trailing_whitespace = true
5+
end_of_line = lf
96
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2

.env.example

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
APP_NAME=DoeSangue
1+
APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_LOG_LEVEL=debug
65
APP_URL=http://localhost
76

7+
LOG_CHANNEL=stack
8+
89
DB_CONNECTION=mysql
910
DB_HOST=127.0.0.1
1011
DB_PORT=3306
11-
DB_DATABASE=doesangue
12-
DB_USERNAME=doesangue
13-
DB_PASSWORD=doesangue
12+
DB_DATABASE=homestead
13+
DB_USERNAME=homestead
14+
DB_PASSWORD=secret
1415

1516
BROADCAST_DRIVER=log
1617
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
1719
SESSION_DRIVER=file
1820
SESSION_LIFETIME=120
19-
QUEUE_DRIVER=sync
2021

21-
REDIS_HOST=cache
22+
REDIS_HOST=127.0.0.1
2223
REDIS_PASSWORD=null
2324
REDIS_PORT=6379
2425

2526
MAIL_DRIVER=smtp
26-
MAIL_HOST=mailtrap.io
27+
MAIL_HOST=smtp.mailtrap.io
2728
MAIL_PORT=2525
2829
MAIL_USERNAME=null
2930
MAIL_PASSWORD=null
3031
MAIL_ENCRYPTION=null
3132

33+
AWS_ACCESS_KEY_ID=
34+
AWS_SECRET_ACCESS_KEY=
35+
AWS_DEFAULT_REGION=us-east-1
36+
AWS_BUCKET=
37+
3238
PUSHER_APP_ID=
3339
PUSHER_APP_KEY=
3440
PUSHER_APP_SECRET=
41+
PUSHER_APP_CLUSTER=mt1
42+
43+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
44+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* text=auto
22
*.css linguist-vendored
33
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/node_modules
2+
/public/hot
23
/public/storage
34
/storage/*.key
45
/vendor
5-
/.idea
6-
*swp
76
.env
8-
bower_components
9-
.git/
10-
.env.testing
11-
#composer.lock
12-
.theia/
7+
.phpunit.result.cache
8+
Homestead.json
9+
Homestead.yaml
10+
npm-debug.log
11+
yarn-error.log
1312
composer.lock
14-
Procfile

.scrutinizer.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ build:
4545

4646
variables:
4747
APP_KEY: base64:D6N/Z/7E0B1M3l1GumT+Kp+JT7E4bzbeMRuxzV3CP1s=
48-
DB_DATABASE: doesangue
48+
DB_DATABASE: giveblood_test
4949
DB_USERNAME: root
5050
DB_CONNECTION: mysql
5151
APP_ENV: testing
5252

5353
dependencies:
5454
before:
55-
- mysql -uroot -e 'CREATE DATABASE doesangue'
55+
- mysql -uroot -e 'CREATE DATABASE giveblood_test'
5656

5757
tests:
5858
override:

.travis.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
language: php
22
php:
3-
- 7.1
3+
#- 7.1
4+
- 7.2
5+
- 7.3
46
- nightly
7+
58
addons:
69
postgresql: '9.6'
710
code_climate:
@@ -18,14 +21,16 @@ dist: trusty
1821
notifications:
1922
slack:
2023
secure: g5gScU7zKCyMI1gZnoezl4VDAFQ5DZgr/Vav5kVbxCiItw+J6vvMqygmK5CFwNaYwvStJ9tIfJPvbxlRyEfF3qzRyCtpzKelbzyG79y/ecICVFI3Qd52FyXmgk/HrijxqeBU3geSSu1yi9fObf6DpmJ9jBdAeyCJ1dXCaaPe75aq7tPljxd4Qh2Omw/XjTdTqO5YWZ1wM3CAuIrobDtDNQ+fDHpam5Kdb62T9uR0d7MTHygHefoOw+1AWHVggNzAP4uBi7rU3XXMJDeAjUlPw6Mg3SRhsfJ3RechLVq/7dw7fQpHsoG8o6ySqd6CvLT2qFFdQ6kX3nSMIsO49CV8QtghICTwnzqbyhnQeI05tqlkYDC0i9AY4TF7kx4Uy7GvrvjjekJlMBGNLrYzPoSYBIms1lGbprqDAASoM73m4IhNWQ0GQiMeIf1ctrgzj0H0SxPPGSANn57YIAfhsioXsR/ChvNhreUyNHBinAO3afR7VI0utsPLwWiKzvDDh7NzIwqFzgQAeocu3pbuStPk1/hQZiMjJINNlFPHv/00j36+YuqKJxPM1y+fis1cloEsHhx29tKy9RtqyHlXsszTM34gbmQuSzJ+oLaaKm63uCAAPJFgb1g01/57ZlIbnZ9riGIORMkoJvqbDO7MRllpGFvSVjewSy6XroC5wjlGSZ4=
21-
install: composer install
24+
install:
25+
- composer install
26+
- composer require codedungeon/phpunit-result-printer
2227
before_script:
23-
- psql -c 'create database doesangue_test;' -U postgres
24-
- composer require codeclimate/php-test-reporter --dev
28+
- psql -c 'create database giveblood_test;' -U postgres
29+
#- composer require codeclimate/php-test-reporter --dev
2530
script:
2631
- php artisan migrate --env=testing --no-interaction
27-
- vendor/bin/phpunit
32+
- ./vendor/bin/phpunit
2833
- sh ./cache-clean.sh
2934
after_success:
3035
- bash <(curl -s https://codecov.io/bash)
31-
- vendor/bin/test-reporter
36+
#- vendor/bin/test-reporter

app/Console/Commands/MakeModelCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DoeSangue\Console\Commands;
3+
namespace GiveBlood\Console\Commands;
44

55
//use Illuminate\Console\Command;
66
use Illuminate\Foundation\Console\ModelMakeCommand;
@@ -19,14 +19,14 @@ class MakeModelCommand extends ModelMakeCommand
1919
*
2020
* @var string
2121
*/
22-
protected $description = 'Create a new model class with Models namespace';
22+
protected $description = 'Create a new model class with Modules namespace';
2323

2424

2525
protected function getPath($name)
2626
{
2727
$name = str_replace_first($this->rootNamespace(), '', $name);
2828

29-
return $this->laravel[ 'path' ].'/Models/'.str_replace('\\', '/', $name).'.php';
29+
return $this->laravel[ 'path' ].'/Modules/'.str_replace('\\', '/', $name).'.php';
3030
}
3131
/**
3232
* Get the root namespace for the class.
@@ -35,7 +35,7 @@ protected function getPath($name)
3535
*/
3636
protected function rootNamespace()
3737
{
38-
return $this->laravel->getNamespace().'Models';
38+
return $this->laravel->getNamespace().'Modules';
3939
}
4040

4141
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace GiveBlood\Console\Commands;
4+
5+
use Illuminate\Foundation\Console\ProviderMakeCommand;
6+
7+
class MakeProviderCommand extends ProviderMakeCommand
8+
{
9+
10+
/**
11+
* The console command description.
12+
*
13+
* @var string
14+
*/
15+
protected $description = 'Create a new custom service provider class';
16+
17+
/**
18+
* The type of class being generated.
19+
*
20+
* @var string
21+
*/
22+
protected $type = 'Provider';
23+
24+
/**
25+
* Get the stub file for the generator.
26+
*
27+
* @return string
28+
*/
29+
protected function getStub()
30+
{
31+
return __DIR__.'/stubs/provider.stub';
32+
}
33+
34+
/**
35+
* Get the default namespace for the class.
36+
*
37+
* @param string $rootNamespace
38+
* @return string
39+
*/
40+
protected function getDefaultNamespace($rootNamespace)
41+
{
42+
return $rootNamespace.'\Modules';
43+
}
44+
}
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace DummyNamespace;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
use Migrator\MigratorTrait as LaravelMigrator;
7+
8+
class DummyClass extends ServiceProvider
9+
{
10+
use LaravelMigrator;
11+
12+
public function register()
13+
{
14+
$this->registerMigrations();
15+
//$this->registerFactories();
16+
//$this->registerSeeders();
17+
}
18+
19+
public function registerMigrations()
20+
{
21+
$this->migrations(
22+
[
23+
//
24+
]
25+
);
26+
}
27+
28+
public function registerFactories()
29+
{
30+
//
31+
}
32+
33+
public function registerSeeders()
34+
{
35+
//
36+
}
37+
}
File renamed without changes.

app/Console/Kernel.php

100755100644
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DoeSangue\Console;
3+
namespace GiveBlood\Console;
44

55
use Illuminate\Console\Scheduling\Schedule;
66
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -13,13 +13,14 @@ class Kernel extends ConsoleKernel
1313
* @var array
1414
*/
1515
protected $commands = [
16-
\DoeSangue\Console\Commands\MakeModelCommand::class
16+
//
1717
];
1818

1919
/**
2020
* Define the application's command schedule.
2121
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
2324
*/
2425
protected function schedule(Schedule $schedule)
2526
{
@@ -29,11 +30,13 @@ protected function schedule(Schedule $schedule)
2930

3031
/**
3132
* Register the commands for the application.
33+
*
34+
* @return void
3235
*/
3336
protected function commands()
3437
{
3538
$this->load(__DIR__.'/Commands');
3639

37-
include base_path('routes/console.php');
40+
require (__DIR__.'/ConsoleRoute.php');
3841
}
3942
}

app/GraphQL/Mutation/CreateCampaignMutation.php

-16
This file was deleted.

app/GraphQL/Mutation/NewBankMutation.php

-8
This file was deleted.

app/GraphQL/Mutation/UpdateProfileMutation.php

-8
This file was deleted.

app/GraphQL/Query/BloodGroupsQuery.php

-8
This file was deleted.

app/GraphQL/Query/CampaignsQuery.php

-8
This file was deleted.

0 commit comments

Comments
 (0)