Skip to content

Commit f70dfd3

Browse files
Upgrade to Laravel 5.1
1 parent 61ffdce commit f70dfd3

File tree

11 files changed

+112
-113
lines changed

11 files changed

+112
-113
lines changed

app/Commands/Command.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/Handlers/Events/.gitkeep

Whitespace-only changes.
Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,65 @@
1-
<?php namespace App\Http\Controllers\Auth;
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
24

35
use App\Http\Controllers\Controller;
4-
use Illuminate\Contracts\Auth\Guard;
5-
use Illuminate\Contracts\Auth\Registrar;
6+
use App\User;
67
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
8+
use Illuminate\Foundation\Auth\ThrottlesLogins;
9+
use Validator;
710

8-
class AuthController extends Controller {
9-
10-
/*
11-
|--------------------------------------------------------------------------
12-
| Registration & Login Controller
13-
|--------------------------------------------------------------------------
14-
|
15-
| This controller handles the registration of new users, as well as the
16-
| authentication of existing users. By default, this controller uses
17-
| a simple trait to add these behaviors. Why don't you explore it?
18-
|
19-
*/
11+
class AuthController extends Controller
12+
{
13+
/*
14+
|--------------------------------------------------------------------------
15+
| Registration & Login Controller
16+
|--------------------------------------------------------------------------
17+
|
18+
| This controller handles the registration of new users, as well as the
19+
| authentication of existing users. By default, this controller uses
20+
| a simple trait to add these behaviors. Why don't you explore it?
21+
|
22+
*/
2023

21-
use AuthenticatesAndRegistersUsers;
24+
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
2225

23-
/**
24-
* Create a new authentication controller instance.
25-
*
26-
* @param \Illuminate\Contracts\Auth\Guard $auth
27-
* @param \Illuminate\Contracts\Auth\Registrar $registrar
28-
* @return void
29-
*/
30-
public function __construct(Guard $auth, Registrar $registrar)
31-
{
32-
$this->auth = $auth;
33-
$this->registrar = $registrar;
26+
/**
27+
* Create a new authentication controller instance.
28+
*
29+
* @return void
30+
*/
31+
public function __construct()
32+
{
33+
$this->middleware('guest', ['except' => 'getLogout']);
34+
}
3435

35-
$this->middleware('guest', ['except' => 'getLogout']);
36-
}
36+
/**
37+
* Get a validator for an incoming registration request.
38+
*
39+
* @param array $data
40+
* @return \Illuminate\Contracts\Validation\Validator
41+
*/
42+
protected function validator(array $data)
43+
{
44+
return Validator::make($data, [
45+
'name' => 'required|max:255',
46+
'email' => 'required|email|max:255|unique:users',
47+
'password' => 'required|confirmed|min:6',
48+
]);
49+
}
3750

51+
/**
52+
* Create a new user instance after a valid registration.
53+
*
54+
* @param array $data
55+
* @return User
56+
*/
57+
protected function create(array $data)
58+
{
59+
return User::create([
60+
'name' => $data['name'],
61+
'email' => $data['email'],
62+
'password' => bcrypt($data['password']),
63+
]);
64+
}
3865
}
Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
1-
<?php namespace App\Http\Controllers\Auth;
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
24

35
use App\Http\Controllers\Controller;
4-
use Illuminate\Contracts\Auth\Guard;
5-
use Illuminate\Contracts\Auth\PasswordBroker;
66
use Illuminate\Foundation\Auth\ResetsPasswords;
77

8-
class PasswordController extends Controller {
9-
10-
/*
11-
|--------------------------------------------------------------------------
12-
| Password Reset Controller
13-
|--------------------------------------------------------------------------
14-
|
15-
| This controller is responsible for handling password reset requests
16-
| and uses a simple trait to include this behavior. You're free to
17-
| explore this trait and override any methods you wish to tweak.
18-
|
19-
*/
20-
21-
use ResetsPasswords;
22-
23-
/**
24-
* Create a new password controller instance.
25-
*
26-
* @param \Illuminate\Contracts\Auth\Guard $auth
27-
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
28-
* @return void
29-
*/
30-
public function __construct(Guard $auth, PasswordBroker $passwords)
31-
{
32-
$this->auth = $auth;
33-
$this->passwords = $passwords;
8+
class PasswordController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Password Reset Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password reset requests
16+
| and uses a simple trait to include this behavior. You're free to
17+
| explore this trait and override any methods you wish to tweak.
18+
|
19+
*/
3420

35-
$this->middleware('guest');
36-
}
21+
use ResetsPasswords;
3722

23+
/**
24+
* Create a new password controller instance.
25+
*
26+
* @return void
27+
*/
28+
public function __construct()
29+
{
30+
$this->middleware('guest');
31+
}
3832
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php namespace App\Http\Controllers;
22

3-
use Illuminate\Foundation\Bus\DispatchesCommands;
4-
use Illuminate\Routing\Controller as BaseController;
3+
use Illuminate\Foundation\Bus\DispatchesJobs;
54
use Illuminate\Foundation\Validation\ValidatesRequests;
5+
use Illuminate\Routing\Controller as BaseController;
66

7-
abstract class Controller extends BaseController {
7+
abstract class Controller extends BaseController
8+
{
89

9-
use DispatchesCommands, ValidatesRequests;
10+
use DispatchesJobs, ValidatesRequests;
1011

1112
}

app/Jobs/Job.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Jobs;
4+
5+
use Illuminate\Bus\Queueable;
6+
7+
abstract class Job
8+
{
9+
/*
10+
|--------------------------------------------------------------------------
11+
| Queueable Jobs
12+
|--------------------------------------------------------------------------
13+
|
14+
| This job base class provides a central location to place any logic that
15+
| is shared across all of your jobs. The trait included with the class
16+
| provides access to the "queueOn" and "delay" queue helper methods.
17+
|
18+
*/
19+
20+
use Queueable;
21+
}
File renamed without changes.

app/Services/Registrar.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

bootstrap/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
|
2828
*/
2929

30-
$compiledPath = __DIR__.'/../storage/framework/compiled.php';
30+
$compiledPath = __DIR__.'/cache/compiled.php';
3131

3232
if (file_exists($compiledPath))
3333
{

bootstrap/cache/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)