Skip to content

Commit a32c0b5

Browse files
committed
Upgrade for Laravel 5.4
1 parent 9379e05 commit a32c0b5

25 files changed

+765
-757
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ language: php
33
php:
44
- 5.6
55
- 7.0
6+
- 7.1
67

78
before_script:
89
- curl -s http://getcomposer.org/installer | php
910
- php composer.phar install --dev
11+
- php composer.phar dump-autoload
1012

1113
script: phpunit
1214

app/Authentication/AuthenticationServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function provides()
172172

173173
private function registerInstallCommand()
174174
{
175-
$this->app['authentication.install'] = $this->app->share(function ($app)
175+
$this->app->singleton('authentication.install', function ($app)
176176
{
177177
return new InstallCommand;
178178
});

app/Authentication/Classes/CustomProfile/Events/ProfilePermissionSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author jacopo beschi jacopo@jacopobeschi.com
99
*/
10-
class ProfilePermissionSubscriber
10+
class ProfilePermissionSubscriber
1111
{
1212
protected $permission_error_message = "You don't have the permission to edit custom the user profiles.";
1313

@@ -32,4 +32,4 @@ public function subscribe($events)
3232
$events->listen('customprofile.deleting', 'LaravelAcl\Authentication\Classes\CustomProfile\Events\ProfilePermissionSubscriber@checkProfileTypePermission');
3333
}
3434

35-
}
35+
}

app/Authentication/Classes/CustomProfile/Repository/CustomProfileRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function getAllTypes()
2727

2828
public static function addNewType($description)
2929
{
30-
// firing event so it can get catched for permission handling
30+
// firing event for permission handling
3131
Event::fire('customprofile.creating');
3232
$profile_field_type = ProfileFieldType::create(["description" => $description]);
3333

@@ -36,7 +36,7 @@ public static function addNewType($description)
3636

3737
public static function deleteType($id)
3838
{
39-
// firing event so it can get catched for permission handling
39+
// firing event for permission handling
4040
Event::fire('customprofile.deleting');
4141
$success = ProfileFieldType::findOrFail($id)->delete();
4242

@@ -144,4 +144,4 @@ protected function fetchProfileValueAssociated($profile_type)
144144
return $profile_type->profile_field()->whereProfileId($this->profile_id)->first()->value;
145145
}
146146

147-
}
147+
}

app/Authentication/Controllers/UserController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use View, Redirect, App, Config;
2525
use LaravelAcl\Authentication\Interfaces\AuthenticateInterface;
2626
use Illuminate\Database\Eloquent\ModelNotFoundException;
27+
use LaravelAcl\Library\Form\FormModel;
2728

2829
class UserController extends Controller {
2930
/**
@@ -48,7 +49,8 @@ public function __construct(UserValidator $v, FormHelper $fh, UserProfileValidat
4849
{
4950
$this->user_repository = App::make('user_repository');
5051
$this->user_validator = $v;
51-
$this->f = App::make('form_model', [$this->user_validator, $this->user_repository]);
52+
//@todo use IOC correctly with a factory and passing the correct parameters
53+
$this->f = new FormModel($this->user_validator, $this->user_repository);
5254
$this->form_helper = $fh;
5355
$this->profile_validator = $vp;
5456
$this->profile_repository = App::make('profile_repository');
@@ -347,4 +349,4 @@ public function refreshCaptcha()
347349
return View::make('laravel-authentication-acl::client.auth.captcha-image')
348350
->with(['captcha' => App::make('captcha_validator')]);
349351
}
350-
}
352+
}

app/Authentication/Services/ReminderService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ public function getMailer()
149149
return $this->mailer;
150150
}
151151

152-
}
152+
}

app/Library/Email/SwiftMailer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function sendTo($to, $body, $subject, $template)
1919
{
2020
try
2121
{
22-
App::make('mailer')->queue($template, ["body" => $body], function($message) use($to, $subject){
22+
App::make('mailer')->send($template, ["body" => $body], function($message) use($to, $subject){
2323
$message->to($to)->subject($subject);
2424
});
2525
}
@@ -36,4 +36,4 @@ public function sendTo($to, $body, $subject, $template)
3636

3737
return true;
3838
}
39-
}
39+
}

app/Library/LibraryServiceProvider.php

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,57 @@
66

77
class LibraryServiceProvider extends ServiceProvider {
88

9-
/**
10-
* Indicates if loading of the provider is deferred.
11-
*
12-
* @var bool
13-
*/
14-
protected $defer = false;
15-
16-
/**
17-
* Bootstrap the application events.
18-
*
19-
* @return void
20-
*/
21-
public function boot()
22-
{
23-
$this->bindMailer();
24-
$this->bindFormModel();
25-
26-
}
27-
28-
protected function bindMailer()
29-
{
30-
$this->app->bind('jmailer', function ()
31-
{
32-
return new SwiftMailer;
33-
});
34-
}
35-
36-
protected function bindFormModel()
9+
/**
10+
* Indicates if loading of the provider is deferred.
11+
*
12+
* @var bool
13+
*/
14+
protected $defer = false;
15+
16+
/**
17+
* Bootstrap the application events.
18+
*
19+
* @return void
20+
*/
21+
public function boot()
22+
{
23+
$this->bindMailer();
24+
$this->bindFormModel();
25+
}
26+
27+
protected function bindMailer()
28+
{
29+
$this->app->bind('jmailer', function ()
3730
{
38-
$this->app->bind('form_model', function ($app, $params) {
39-
// validator, repository
40-
return new FormModel($params[0], $params[1]);
41-
});
42-
}
43-
44-
/**
45-
* Register the service provider.
46-
*
47-
* @return void
48-
*/
49-
public function register()
50-
{
51-
//
52-
}
53-
54-
/**
55-
* Get the services provided by the provider.
56-
*
57-
* @return array
58-
*/
59-
public function provides()
60-
{
61-
return array();
62-
}
63-
64-
}
31+
return new SwiftMailer;
32+
});
33+
}
34+
35+
protected function bindFormModel()
36+
{
37+
$this->app->bind('form_model', function ($app) {
38+
return new FormModel();
39+
});
40+
}
41+
42+
/**
43+
* Register the service provider.
44+
*
45+
* @return void
46+
*/
47+
public function register()
48+
{
49+
//
50+
}
51+
52+
/**
53+
* Get the services provided by the provider.
54+
*
55+
* @return array
56+
*/
57+
public function provides()
58+
{
59+
return array();
60+
}
61+
62+
}

composer.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@
1919
"license": "MIT",
2020
"type": "project",
2121
"require": {
22-
"laravel/framework": "5.3.*",
23-
"laravelcollective/html" : "5.3.*",
22+
"laravel/framework": "5.4.*",
23+
"laravelcollective/html" : "5.4.*",
2424
"intervention/image": "2.*",
25-
"jacopo/authentication-sentry": "3.0.4",
26-
"gregwar/captcha": "1.0.11"
25+
"jacopo/authentication-sentry": "3.0.7",
26+
"gregwar/captcha": "1.1.1"
2727
},
2828
"require-dev": {
29-
"phpunit/phpunit": "~4.0",
30-
"phpspec/phpspec": "~2.1",
29+
"phpunit/phpunit": "~5.7",
3130
"mockery/mockery": "0.9.*",
32-
"fzaninotto/faker": "1.4.*",
33-
"doctrine/dbal": "2.5.*"
34-
31+
"fzaninotto/faker": "~1.4",
32+
"sebastian/exporter": "^2.0"
3533
},
3634
"autoload": {
3735
"classmap": [

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ To install authentication follow this steps:
3232

3333
2. Add to your _composer.json_ require field the following lines:
3434

35+
__For Laravel version 5.4:__
36+
37+
```
38+
"require": {
39+
...
40+
"jacopo/laravel-authentication-acl": "1.4.*"
41+
},
42+
```
43+
3544
__For Laravel version 5.3:__
3645
3746
```

public/packages/jacopo/laravel-authentication-acl/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ div.paginator
165165

166166
.form-error{
167167
border: 1px solid red;
168-
}
168+
}

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ laravel-authentication-acl
44
[![Build Status](https://travis-ci.org/intrip/laravel-authentication-acl.svg?branch=1.3)](https://travis-ci.org/intrip/laravel-authentication-acl)
55
[![Total Downloads](https://poser.pugx.org/jacopo/laravel-authentication-acl/d/total.svg)](https://packagist.org/packages/jacopo/laravel-authentication-acl)
66

7-
## This is the Laravel 5.3 Version, for Laravel 5.2 use the version 1.3.15, for Laravel 5.1/5.0 use the version 1.3.11, for Laravel4 version use the 1.2 branch
7+
## This is the Laravel 5.4 Version, for Laravel 5.3 use the version 1.3.*, for Laravel 5.2 use the version 1.3.15, for Laravel 5.1/5.0 use the version 1.3.11, for Laravel4 version use the 1.2 branch
88

99
Laravel Authentication ACL is a Laravel 5 package, based on <a href="https://github.com/cartalyst/sentry" target="_blank">sentry2</a>. <br/>
1010
This package is made with the purpose of helping other developers to set-up
1111
a fully featured admin panel with an ACL using Laravel framework.
1212

1313
You can see the full documentation and usage [here](docs/index.md)
1414

15-
####Main features:
15+
#### Main features:
1616
- User authentication and signup
1717
- Configurable email confirmation
1818
- Configurable captcha integration
@@ -43,6 +43,6 @@ Please support the project development, even a small donation can help the life
4343

4444
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SZKN8MCQACLSC" target="_blank"><img src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_donate_LG.gif"></a>
4545

46-
####Interested in some new feature?
46+
#### Interested in some new feature?
4747
There's something you like to see in this package?
4848
Contact me and i'll do my best to implement that in next releases.

0 commit comments

Comments
 (0)