Skip to content

Commit

Permalink
Update Laravel from 5.7 to 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
MercierCorentin committed Jul 29, 2019
1 parent f6a185c commit b8dbc5f
Show file tree
Hide file tree
Showing 25 changed files with 3,133 additions and 3,385 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ npm-debug.log
yarn-error.log
.env
.ftpconfig
.phpunit.result.cache

# Front generated filed
public/js/app\.js
public/css/app\.css
Expand All @@ -25,4 +27,4 @@ public/images/articles/*
public/images/assos/*
public/images/events/*
public/images/services/*
.DS_Store
.DS_Store
3 changes: 2 additions & 1 deletion app/Admin/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Support\Facades\{
DB, Input
};
use Illuminate\Support\Arr;

class Form extends BaseForm
{
Expand Down Expand Up @@ -91,7 +92,7 @@ public function update($model_id, $data=null)
if (!$isEditable) {
return back()->withInput()->withErrors($validationMessages);
} else {
return response()->json(['errors' => array_dot($validationMessages->getMessages())], 422);
return response()->json(['errors' => Arr::dot($validationMessages->getMessages())], 422);
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Passport/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Str;
use App\Http\Controllers\Controller;
use App\Exceptions\PortailException;
use App\Models\Client;
Expand Down Expand Up @@ -54,7 +55,7 @@ public function store(Request $request)
'user_id' => \Auth::id(),
'asso_id' => $request->asso_id,
'name' => $request->name,
'secret' => str_random(40),
'secret' => Str::random(40),
'redirect' => $request->redirect,
'personal_access_client' => false,
'password_client' => false,
Expand Down
2 changes: 2 additions & 0 deletions app/Models/AuthApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

class AuthApp extends Auth
{
protected $table = "auth_apps";

protected $fillable = [
'user_id', 'app_id', 'password', 'key',
];
Expand Down
2 changes: 2 additions & 0 deletions app/Models/AuthPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

class AuthPassword extends Auth
{
protected $table = "auth_passwords";

protected $fillable = [
'user_id', 'password', 'last_login_at',
];
Expand Down
4 changes: 0 additions & 4 deletions app/Models/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ class Comment extends Model implements CanBeOwner, OwnableContract, CanHaveComme
'body', 'created_by_id', 'created_by_type', 'owned_by_id', 'owned_by_type',
];

protected $dates = [
'deleted_at'
];

protected $with = [
'created_by', 'owned_by',
];
Expand Down
4 changes: 0 additions & 4 deletions app/Models/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class Group extends Model implements CanBeOwner, CanHaveCalendars, CanHaveEvents
'name', 'user_id', 'icon', 'visibility_id',
];

protected $dates = [
'deleted_at',
];

protected $hidden = [
'user_id', 'visibility_id',
];
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

namespace App\Models;
use Illuminate\Support\Arr;

class Notification extends Model
{
Expand Down Expand Up @@ -55,7 +56,7 @@ public static function boot()
static::creating(function ($model) {
if (isset($model->data['created_by'])) {
$data = $model->data;
$created_by = array_pull($data, 'created_by');
$created_by = Arr::pull($data, 'created_by');
$model->data = $data;

$model->created_by_id = $created_by['id'];
Expand Down
2 changes: 1 addition & 1 deletion app/Pivots/AssoMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function user()
*/
public function asso()
{
return $this->belongsTo(ASso::class);
return $this->belongsTo(Asso::class);
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AuthServiceProvider extends ServiceProvider
'App\Model' => 'App\Policies\ModelPolicy',
];


// It is important to be not deferred because otherwise scopes are not loaded.
protected $defer = false;

Expand Down
3 changes: 2 additions & 1 deletion app/Services/Auth/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use App\Models\User;
use App\Models\AuthApp;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Hash;

class App extends BaseAuth
Expand Down Expand Up @@ -41,7 +42,7 @@ public function addAuth(string $user_id, array $info)
'user_id' => $user_id,
'app_id' => $info['app_id'],
'password' => Hash::make($info['password']),
'key' => str_random(64)
'key' => Str::random()(64)
]);
}
}
28 changes: 18 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"name": "simde-utc/portail-api",
"description": "Portail des Assos de l'UTC.",
"keywords": ["framework", "laravel", "simde", "api", "utc", "students", "clubs", "assos"],
"keywords": [
"framework",
"laravel",
"simde",
"api",
"utc",
"students",
"clubs",
"assos"
],
"license": "GPL-v3",
"type": "project",
"require": {
"php": ">=7.1.3",
"php": ">=7.2",
"cybercog/laravel-ownership": "^5.1",
"diadal/passport": "^1.0@dev",
"doctrine/dbal": "^2.6",
Expand All @@ -15,26 +24,26 @@
"ixudra/curl": "^6.16",
"laravel-admin-ext/chartjs": "^1.0",
"laravel-admin-ext/log-viewer": "^1.0",
"laravel/framework": "5.7.*",
"laravel/framework": "5.8.*",
"laravel/passport": "7.*",
"laravel/tinker": "~1.0",
"mews/captcha": "^2.2",
"nastuzzi-samy/api-tester": "^1.1",
"nastuzzi-samy/laravel-model-stages": "^1.0",
"nastuzzi-samy/laravel-query-selection": "^2.2",
"nunomaduro/larastan": "^0.3.17",
"phpmd/phpmd": "^2.6",
"predis/predis": "^1.1",
"webpatser/laravel-uuid": "^3.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"fzaninotto/faker": "1.*",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "3.0.*",
"phpunit/phpunit": "~7.0",
"phpunit/phpunit": "~8.0",
"squizlabs/php_codesniffer": "3.*",
"symfony/thanks": "^1.0",
"squizlabs/php_codesniffer": "3.*"
"nunomaduro/larastan": "^0.3.17",
"phpmd/phpmd": "^2.6"
},
"autoload": {
"classmap": [
Expand All @@ -55,8 +64,7 @@
},
"extra": {
"laravel": {
"dont-discover": [
]
"dont-discover": []
}
},
"scripts": {
Expand Down
Loading

0 comments on commit b8dbc5f

Please sign in to comment.