Skip to content

Commit

Permalink
Merge pull request #14 from gdarko/shift-120752
Browse files Browse the repository at this point in the history
Upgrade to Laravel 11
  • Loading branch information
gdarko authored Jun 2, 2024
2 parents fa5f6fb + 38f858f commit 6843a9e
Show file tree
Hide file tree
Showing 96 changed files with 789 additions and 2,719 deletions.
66 changes: 41 additions & 25 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,68 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOCALE=en
APP_TIMEZONE=UTC
APP_URL=http://yourdomain.test
APP_LOGO=/assets/images/logo.png
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=vagrant
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

MEMCACHED_HOST=memcached
CACHE_STORE=database
CACHE_PREFIX=

REDIS_HOST=redis
MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=test@test.com
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"

# Customizations
APP_LOGO=/assets/images/logo.png
SANCTUM_STATEFUL_DOMAINS=yourdomain.test
SESSION_DOMAIN=yourdomain.test
SPA_URL="${APP_URL}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
Expand All @@ -6,12 +7,15 @@
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode

Expand Down
1 change: 0 additions & 1 deletion app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class CreateNewUser implements CreatesNewUsers
/**
* Validate and create a newly registered user.
*
* @param array $input
* @return \App\Models\User
*/
public function create(array $input)
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Fortify/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ResetUserPassword implements ResetsUserPasswords
* Validate and reset the user's forgotten password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function reset($user, array $input)
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class UpdateUserPassword implements UpdatesUserPasswords
* Validate and update the user's password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
Expand Down
2 changes: 0 additions & 2 deletions app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
* Validate and update the given user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
Expand Down Expand Up @@ -49,7 +48,6 @@ public function update($user, array $input)
* Update the given verified user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
protected function updateVerifiedUser($user, array $input)
Expand Down
32 changes: 0 additions & 32 deletions app/Console/Kernel.php

This file was deleted.

50 changes: 0 additions & 50 deletions app/Exceptions/Handler.php

This file was deleted.

30 changes: 4 additions & 26 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Auth;

class Controller extends BaseController
abstract class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

/**
* Returns the current user
*
* @return User|\Illuminate\Contracts\Auth\Authenticatable|null
*/
protected function getCurrentUser()
Expand All @@ -25,7 +26,7 @@ protected function getCurrentUser()

/**
* Send data response
* @param array $data
*
* @return JsonResponse
*/
protected function responseDataSuccess(array $data)
Expand All @@ -36,21 +37,16 @@ protected function responseDataSuccess(array $data)
/**
* Send a successful response
*
* @param $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseDeleteSuccess($data = [], $code = 200)
{
return $this->responseSuccess(trans('frontend.global.phrases.record_deleted'), $data, $code);
}


/**
* Send a failed response
*
* @param array $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseDeleteFail(array $data = [], int $code = 422)
Expand All @@ -61,21 +57,16 @@ protected function responseDeleteFail(array $data = [], int $code = 422)
/**
* Send a successful response
*
* @param $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseUpdateSuccess($data = [], $code = 200)
{
return $this->responseSuccess(trans('frontend.global.phrases.record_updated'), $data, $code);
}


/**
* Send a failed response
*
* @param array $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseUpdateFail(array $data = [], int $code = 422)
Expand All @@ -86,21 +77,16 @@ protected function responseUpdateFail(array $data = [], int $code = 422)
/**
* Send a successful response
*
* @param $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseStoreSuccess($data = [], $code = 200)
{
return $this->responseSuccess(trans('frontend.global.phrases.record_created'), $data, $code);
}


/**
* Send a failed response
*
* @param array $data
* @param $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseStoreFail(array $data = [], int $code = 422)
Expand All @@ -111,9 +97,6 @@ protected function responseStoreFail(array $data = [], int $code = 422)
/**
* Send a successful response
*
* @param string $message
* @param array $data
* @param int $code
* @return JsonResponse
*/
protected function responseSuccess(string $message, array $data = [], int $code = 200)
Expand All @@ -124,9 +107,6 @@ protected function responseSuccess(string $message, array $data = [], int $code
/**
* Send a failed response
*
* @param string $message
* @param array $data
* @param int $code
* @return \Illuminate\Http\JsonResponse
*/
protected function responseFail(string $message, array $data = [], int $code = 400)
Expand All @@ -136,9 +116,7 @@ protected function responseFail(string $message, array $data = [], int $code = 4

/**
* Returns a response
* @param int $code
* @param string $message
* @param array $data
*
* @return JsonResponse
*/
protected function response(int $code, string $message = '', array $data = [])
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Controllers/RoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class RoleController extends Controller
{
/**
* The service instance
*
* @var RoleService
*/
protected $roleService;

/**
* Constructor
* @param RoleService $service
*/
public function __construct(RoleService $service)
{
Expand All @@ -26,12 +26,15 @@ public function __construct(RoleService $service)

/**
* Handle search data
*
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
*
* @throws AuthorizationException
*/
public function search(Request $request)
{
$this->authorize('search', Role::class);

return $this->roleService->index($request->all());
}
}
Loading

0 comments on commit 6843a9e

Please sign in to comment.