Skip to content

Commit 6bb9746

Browse files
authored
Merge pull request #1468 from rappasoft/development
Laravel 8
2 parents 966f38a + 29b5501 commit 6bb9746

File tree

98 files changed

+5042
-2559
lines changed

Some content is hidden

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

98 files changed

+5042
-2559
lines changed

.env.example

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ APP_READ_ONLY=false
99
APP_READ_ONLY_LOGIN=true
1010
DEBUGBAR_ENABLED=false
1111
LOG_CHANNEL=daily
12+
LOG_LEVEL=debug
1213

1314
# Drivers
1415
DB_CONNECTION=mysql
@@ -69,13 +70,8 @@ PASSWORD_EXPIRES_DAYS=180
6970
# Get your credentials at: https://www.google.com/recaptcha/admin
7071
LOGIN_CAPTCHA_STATUS=false
7172
REGISTRATION_CAPTCHA_STATUS=false
72-
7373
INVISIBLE_RECAPTCHA_SITEKEY=
7474
INVISIBLE_RECAPTCHA_SECRETKEY=
75-
INVISIBLE_RECAPTCHA_BADGEHIDE=false
76-
INVISIBLE_RECAPTCHA_DATABADGE='bottomright'
77-
INVISIBLE_RECAPTCHA_TIMEOUT=5
78-
INVISIBLE_RECAPTCHA_DEBUG=false
7975

8076
# Socialite Providers
8177
FACEBOOK_ACTIVE=false

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,46 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
55

6+
## [8.0.0] - 2020-10-21
7+
8+
## Added
9+
10+
- Added back roave/security-advisories
11+
- Added new database factories
12+
- Added Polish languages
13+
- Added BladeServiceProvider with @captcha directive
14+
- Added Captcha rule
15+
- Added Captcha configs to boilerplate configs
16+
17+
## Changed
18+
19+
- Update livewire tables to 0.3
20+
- Updated users/roles table to use new tables
21+
- Moved livewire components into Frontend/Backend and updated calls
22+
- Removed type partial and just merged into table format
23+
- Update PHP to 7.3
24+
- Update Guzzle to v7
25+
- Update Laravel to v8
26+
- Update Socialite to v5
27+
- Update Laravel UI to v3
28+
- Update Lockout to v3
29+
- Update Breadcrumbs to v2
30+
- Update PHP Pretty Printer to v0.29
31+
- Update Ignition to v2.3.6
32+
- Update Collision to v5
33+
- Condense .env.example
34+
- Updated tests to use new factories
35+
- Updated seeders and factories to be namespaced
36+
- Follow Laravel upgrade guide for v8 and change all the needed files
37+
- Update to Laravel commit: 8d3ca07c4cff6d36593625ee4b34e19ce2dba15b
38+
- Update CS/FR/IN languages
39+
- Sort locale dropdown by language not array key
40+
- Modified login/register controllers to use new Captcha rule
41+
42+
## Removed
43+
44+
- Remove recaptcha
45+
646
## [7.2.5] - 2020-08-06
747

848
## Changed
@@ -342,7 +382,9 @@ Started from scratch with a blank Laravel 7.* installation. This release is not
342382
- Fix yarn tests
343383
- Fix: Socially logged in users get assigned the default role
344384

345-
[Unreleased]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.5...development
385+
[Unreleased]: https://github.com/rappasoft/laravel-boilerplate/compare/v8.0.0...development
386+
[8.0.0]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.6...v8.0.0
387+
[7.2.6]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.5...v7.2.6
346388
[7.2.5]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.4...v7.2.5
347389
[7.2.4]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.3...v7.2.4
348390
[7.2.3]: https://github.com/rappasoft/laravel-boilerplate/compare/v7.2.2...v7.2.3

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Laravel Boilerplate (Current: Laravel 7.*) ([Demo](https://demo.laravel-boilerplate.com))
1+
## Laravel Boilerplate (Current: Laravel 8.*) ([Demo](https://demo.laravel-boilerplate.com))
22

33
[![Latest Stable Version](https://poser.pugx.org/rappasoft/laravel-boilerplate/v/stable)](https://packagist.org/packages/rappasoft/laravel-boilerplate)
44
[![Latest Unstable Version](https://poser.pugx.org/rappasoft/laravel-boilerplate/v/unstable)](https://packagist.org/packages/rappasoft/laravel-boilerplate)
@@ -21,11 +21,9 @@
2121

2222
[Click here for the official documentation](http://laravel-boilerplate.com)
2323

24-
<a href="https://tracking.gitads.io/?repo=laravel-boilerplate"><img src="https://images.gitads.io/laravel-boilerplate" alt="GitAds"/></a>
25-
2624
### Slack Channel
2725

28-
Please join us in our Slack channel to get faster responses to your questions. Get your invite here: https://laravel-boilerplate.herokuapp.com
26+
Please join us in our Slack channel to get faster responses to your questions. Get your invite here: https://laravel-5-boilerplate.herokuapp.com
2927

3028
### Introduction
3129

app/Domains/Announcement/Models/Announcement.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace App\Domains\Announcement\Models;
44

55
use App\Domains\Announcement\Models\Traits\Scope\AnnouncementScope;
6+
use Database\Factories\AnnouncementFactory;
7+
use Illuminate\Database\Eloquent\Factories\HasFactory;
68
use Illuminate\Database\Eloquent\Model;
79
use Spatie\Activitylog\Traits\LogsActivity;
810

@@ -12,6 +14,7 @@
1214
class Announcement extends Model
1315
{
1416
use AnnouncementScope,
17+
HasFactory,
1518
LogsActivity;
1619

1720
public const TYPE_FRONTEND = 'frontend';
@@ -46,4 +49,14 @@ class Announcement extends Model
4649
protected $casts = [
4750
'enabled' => 'boolean',
4851
];
52+
53+
/**
54+
* Create a new factory instance for the model.
55+
*
56+
* @return \Illuminate\Database\Eloquent\Factories\Factory
57+
*/
58+
protected static function newFactory()
59+
{
60+
return AnnouncementFactory::new();
61+
}
4962
}

app/Domains/Auth/Http/Controllers/Frontend/Auth/LoginController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use App\Domains\Auth\Events\User\UserLoggedIn;
66
use App\Http\Controllers\Controller;
7+
use App\Rules\Captcha;
78
use Illuminate\Foundation\Auth\AuthenticatesUsers;
8-
use Illuminate\Http\Exceptions\HttpResponseException;
99
use Illuminate\Http\Request;
1010
use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules;
1111

@@ -60,7 +60,7 @@ protected function validateLogin(Request $request)
6060
$request->validate([
6161
$this->username() => ['required', 'max:255', 'string'],
6262
'password' => array_merge(['max:100'], PasswordRules::login()),
63-
'g-recaptcha-response' => ['required_if:captcha_status,true', 'captcha'],
63+
'g-recaptcha-response' => ['required_if:captcha_status,true', new Captcha],
6464
], [
6565
'g-recaptcha-response.required_if' => __('validation.required', ['attribute' => 'captcha']),
6666
]);

app/Domains/Auth/Http/Controllers/Frontend/Auth/RegisterController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Domains\Auth\Services\UserService;
66
use App\Http\Controllers\Controller;
7+
use App\Rules\Captcha;
78
use Illuminate\Foundation\Auth\RegistersUsers;
89
use Illuminate\Support\Facades\Validator;
910
use Illuminate\Validation\Rule;
@@ -77,7 +78,7 @@ protected function validator(array $data)
7778
'email' => ['required', 'string', 'email', 'max:255', Rule::unique('users')],
7879
'password' => array_merge(['max:100'], PasswordRules::register($data['email'] ?? null)),
7980
'terms' => ['required', 'in:1'],
80-
'g-recaptcha-response' => ['required_if:captcha_status,true', 'captcha'],
81+
'g-recaptcha-response' => ['required_if:captcha_status,true', new Captcha],
8182
], [
8283
'terms.required' => __('You must accept the Terms & Conditions.'),
8384
'g-recaptcha-response.required_if' => __('validation.required', ['attribute' => 'captcha']),

app/Domains/Auth/Listeners/RoleEventListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function onUpdated($event)
4040
'type' => $event->role->type,
4141
'name' => $event->role->name,
4242
],
43-
'permissions' =>$event->role->permissions->count() ? $event->role->permissions->pluck('description')->implode(', ') : 'None',
43+
'permissions' => $event->role->permissions->count() ? $event->role->permissions->pluck('description')->implode(', ') : 'None',
4444
])
4545
->log(':causer.name updated role :subject.name with permissions: :properties.permissions');
4646
}

app/Domains/Auth/Models/Role.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
use App\Domains\Auth\Models\Traits\Attribute\RoleAttribute;
66
use App\Domains\Auth\Models\Traits\Method\RoleMethod;
7+
use Database\Factories\RoleFactory;
8+
use Illuminate\Database\Eloquent\Factories\HasFactory;
79
use Spatie\Permission\Models\Role as SpatieRole;
810

911
/**
1012
* Class Role.
1113
*/
1214
class Role extends SpatieRole
1315
{
14-
use RoleAttribute,
16+
use HasFactory,
17+
RoleAttribute,
1518
RoleMethod;
1619

1720
/**
@@ -20,4 +23,14 @@ class Role extends SpatieRole
2023
protected $with = [
2124
'permissions',
2225
];
26+
27+
/**
28+
* Create a new factory instance for the model.
29+
*
30+
* @return \Illuminate\Database\Eloquent\Factories\Factory
31+
*/
32+
protected static function newFactory()
33+
{
34+
return RoleFactory::new();
35+
}
2336
}

app/Domains/Auth/Models/User.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
use App\Domains\Auth\Notifications\Frontend\VerifyEmail;
1111
use DarkGhostHunter\Laraguard\Contracts\TwoFactorAuthenticatable;
1212
use DarkGhostHunter\Laraguard\TwoFactorAuthentication;
13+
use Database\Factories\UserFactory;
1314
use Illuminate\Auth\MustVerifyEmail as MustVerifyEmailTrait;
1415
use Illuminate\Contracts\Auth\MustVerifyEmail;
16+
use Illuminate\Database\Eloquent\Factories\HasFactory;
1517
use Illuminate\Database\Eloquent\SoftDeletes;
1618
use Illuminate\Foundation\Auth\User as Authenticatable;
1719
use Illuminate\Notifications\Notifiable;
@@ -23,7 +25,8 @@
2325
*/
2426
class User extends Authenticatable implements MustVerifyEmail, TwoFactorAuthenticatable
2527
{
26-
use HasRoles,
28+
use HasFactory,
29+
HasRoles,
2730
Impersonate,
2831
MustVerifyEmailTrait,
2932
Notifiable,
@@ -144,4 +147,14 @@ public function canBeImpersonated(): bool
144147
{
145148
return ! $this->isMasterAdmin();
146149
}
150+
151+
/**
152+
* Create a new factory instance for the model.
153+
*
154+
* @return \Illuminate\Database\Eloquent\Factories\Factory
155+
*/
156+
protected static function newFactory()
157+
{
158+
return UserFactory::new();
159+
}
147160
}

app/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Handler extends ExceptionHandler
2828
* @param \Throwable $exception
2929
* @return void
3030
*
31-
* @throws \Exception
31+
* @throws \Throwable
3232
*/
3333
public function report(Throwable $exception)
3434
{

0 commit comments

Comments
 (0)