Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcvlad committed Oct 8, 2024
1 parent 4c7a4f2 commit d844f9b
Show file tree
Hide file tree
Showing 21 changed files with 248 additions and 303 deletions.
29 changes: 0 additions & 29 deletions app/Exceptions/Handler.php

This file was deleted.

3 changes: 0 additions & 3 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
}
63 changes: 0 additions & 63 deletions app/Http/Kernel.php

This file was deleted.

37 changes: 31 additions & 6 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use LaravelEnso\Sentry\Exceptions\Handler;

$globalMiddlaware = [
\LaravelEnso\Core\Http\Middleware\AuthorizationCookie::class,
\Illuminate\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\Illuminate\Foundation\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];

return Application::configure(basePath: dirname(__DIR__))
->withRouting(
Expand All @@ -11,9 +22,23 @@
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();
->withMiddleware(fn (Middleware $middleware) => $middleware
->use($globalMiddlaware)
->prependToGroup('api', [
\LaravelEnso\Core\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
])
->appendToGroup('wev', [
\LaravelEnso\ControlPanelApi\Http\Middleware\RequestMonitor::class,
])
->priority([
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Illuminate\Auth\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
\LaravelEnso\ControlPanelApi\Http\Middleware\RequestMonitor::class,
]))
->withExceptions(fn (Exceptions $exceptions) => $exceptions
->reportable(static fn (Throwable $exception) => Handler::report($exception)))
->create();
42 changes: 23 additions & 19 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/

'defaults' => [
'guard' => 'api',
'passwords' => 'users',
'guard' => env('AUTH_GUARD', 'api'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],

/*
Expand All @@ -25,13 +25,13 @@
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session", "token"
| Supported: "session"
|
*/

Expand All @@ -53,12 +53,12 @@
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
Expand All @@ -68,7 +68,7 @@
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
'model' => env('AUTH_MODEL', App\Models\User::class),
],

// 'users' => [
Expand All @@ -82,20 +82,24 @@
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expire time is the number of minutes that each reset token will be
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/

'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_reset_tokens',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
Expand All @@ -107,11 +111,11 @@
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/

'password_timeout' => 60 * 60,
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 60 * 60),

];
10 changes: 7 additions & 3 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
|
*/

'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'sq_lite'),

/*
|--------------------------------------------------------------------------
Expand All @@ -41,6 +41,9 @@
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],

'mysql' => [
Expand Down Expand Up @@ -71,7 +74,7 @@
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
Expand All @@ -86,7 +89,7 @@
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
],
Expand All @@ -105,6 +108,7 @@
*/

'migrations' => 'migrations',
'update_date_on_publish' => false,

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion config/enso/config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

return [
'version' => '6.0.0',
'version' => '7.0.0',
'ownerCompanyId' => (int) env('OWNER_COMPANY_ID', 1),
'showQuote' => (bool) env('SHOW_QUOTE', true),
'defaultRole' => 'admin',
Expand Down
1 change: 1 addition & 0 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
// 'serve' => true,
],

'public' => [
Expand Down
54 changes: 0 additions & 54 deletions config/hashing.php

This file was deleted.

Loading

0 comments on commit d844f9b

Please # to comment.