@@ -68,8 +68,8 @@ |
||
| 68 | 68 | 'body' => 'required', |
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | - $data = request()->only(['title', 'body', 'forked_id']); |
|
| 72 | - $data['user_id'] = auth()->user()->id; |
|
| 71 | + $data = request()->only([ 'title', 'body', 'forked_id' ]); |
|
| 72 | + $data[ 'user_id' ] = auth()->user()->id; |
|
| 73 | 73 | |
| 74 | 74 | Snippet::create($data); |
| 75 | 75 | |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use DB; |
|
| 6 | 5 | use App\Snippet; |
| 6 | +use DB; |
|
| 7 | 7 | |
| 8 | 8 | class SnippetsController extends Controller |
| 9 | 9 | { |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct() |
| 36 | 36 | { |
| 37 | - $this->middleware('guest', ['except' => 'logout']); |
|
| 37 | + $this->middleware('guest', [ 'except' => 'logout' ]); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -64,10 +64,10 @@ |
||
| 64 | 64 | protected function create(array $data) |
| 65 | 65 | { |
| 66 | 66 | return User::create([ |
| 67 | - 'name' => $data['name'], |
|
| 68 | - 'username' => $data['username'], |
|
| 69 | - 'email' => $data['email'], |
|
| 70 | - 'password' => bcrypt($data['password']), |
|
| 67 | + 'name' => $data[ 'name' ], |
|
| 68 | + 'username' => $data[ 'username' ], |
|
| 69 | + 'email' => $data[ 'email' ], |
|
| 70 | + 'password' => bcrypt($data[ 'password' ]), |
|
| 71 | 71 | ]); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers\Auth; |
| 4 | 4 | |
| 5 | -use App\User; |
|
| 6 | 5 | use App\Http\Controllers\Controller; |
| 7 | -use Illuminate\Support\Facades\Validator; |
|
| 6 | +use App\User; |
|
| 8 | 7 | use Illuminate\Foundation\Auth\RegistersUsers; |
| 8 | +use Illuminate\Support\Facades\Validator; |
|
| 9 | 9 | |
| 10 | 10 | class RegisterController extends Controller |
| 11 | 11 | { |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Model extends Eloquent |
| 8 | 8 | { |
| 9 | - protected $guarded = []; |
|
| 9 | + protected $guarded = [ ]; |
|
| 10 | 10 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | protected function unauthenticated($request, AuthenticationException $exception) |
| 58 | 58 | { |
| 59 | 59 | if ($request->expectsJson()) { |
| 60 | - return response()->json(['error' => 'Unauthenticated.'], 401); |
|
| 60 | + return response()->json([ 'error' => 'Unauthenticated.' ], 401); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return redirect()->guest(route('login')); |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App; |
| 4 | 4 | |
| 5 | -use Illuminate\Notifications\Notifiable; |
|
| 6 | 5 | use Illuminate\Foundation\Auth\User as Authenticatable; |
| 6 | +use Illuminate\Notifications\Notifiable; |
|
| 7 | 7 | |
| 8 | 8 | class User extends Authenticatable |
| 9 | 9 | { |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Illuminate\Support\Facades\Schema; |
|
| 4 | -use Illuminate\Database\Schema\Blueprint; |
|
| 5 | 3 | use Illuminate\Database\Migrations\Migration; |
| 4 | +use Illuminate\Database\Schema\Blueprint; |
|
| 5 | +use Illuminate\Support\Facades\Schema; |
|
| 6 | 6 | |
| 7 | 7 | class CreateUsersTable extends Migration |
| 8 | 8 | { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 16 | + Schema::create('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->string('username')->unique(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Illuminate\Support\Facades\Schema; |
|
| 4 | -use Illuminate\Database\Schema\Blueprint; |
|
| 5 | 3 | use Illuminate\Database\Migrations\Migration; |
| 4 | +use Illuminate\Database\Schema\Blueprint; |
|
| 5 | +use Illuminate\Support\Facades\Schema; |
|
| 6 | 6 | |
| 7 | 7 | class CreatePasswordResetsTable extends Migration |
| 8 | 8 | { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | + Schema::create('password_resets', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('email')->index(); |
| 18 | 18 | $table->string('token')->index(); |
| 19 | 19 | $table->timestamp('created_at')->nullable(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Illuminate\Support\Facades\Schema; |
|
| 4 | -use Illuminate\Database\Schema\Blueprint; |
|
| 5 | 3 | use Illuminate\Database\Migrations\Migration; |
| 4 | +use Illuminate\Database\Schema\Blueprint; |
|
| 5 | +use Illuminate\Support\Facades\Schema; |
|
| 6 | 6 | |
| 7 | 7 | class CreateSnippetsTable extends Migration |
| 8 | 8 | { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('snippets', function (Blueprint $table) { |
|
| 16 | + Schema::create('snippets', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->unsignedInteger('user_id'); |
| 19 | 19 | $table->unsignedInteger('forked_id')->nullable(); |