Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #35

Merged
merged 4 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ yarn-error.log
/.idea
/.vscode
composer.lock
package-lock.json
package-lock.json
/bootstrap/cache
3 changes: 3 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Builder;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;

final class AppServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -38,5 +39,7 @@ public function boot(): void
*/
Schema::defaultStringLength(191);
// Builder::defaultStringLength(191);

Vite::prefetch(concurrency: 3);
}
}
75 changes: 22 additions & 53 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,25 @@

declare(strict_types=1);

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/

$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/

$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);

$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);

$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);

/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/

return $app;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: [
__DIR__.'/../routes/web.php',
__DIR__.'/../routes/ajax.php',
__DIR__.'/../routes/admin.php',
],
commands: __DIR__.'/../routes/console.php',
channels: __DIR__.'/../routes/channels.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->web(append: [
Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
]);
})
->withExceptions(function (Exceptions $exceptions): void {})
->create();
2 changes: 0 additions & 2 deletions bootstrap/cache/.gitignore

This file was deleted.

Empty file added bootstrap/cache/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions bootstrap/providers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
App\Providers\AppServiceProvider::class,
];
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"laravel/socialite": "^v5.16.0",
"laravel/tinker": "^v2.10.0",
"laravel/ui": "^v4.5.2",
"nejcc/php-datatypes": "^1.0",
"spatie/laravel-cookie-consent": "^3.3.2",
"spatie/laravel-permission": "^6.9.0"
},
Expand Down
160 changes: 81 additions & 79 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
|
*/

'timezone' => 'UTC',
'timezone' => env('APP_TIMEZONE', 'UTC'),

/*
|--------------------------------------------------------------------------
Expand All @@ -101,7 +101,7 @@
|
*/

'locale' => 'en',
'locale' => env('APP_LOCALE', 'en'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -137,7 +137,7 @@
|
*/

'fallback_locale' => 'en',
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),

/*
|--------------------------------------------------------------------------
Expand All @@ -150,7 +150,7 @@
|
*/

'faker_locale' => 'en_US',
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -181,85 +181,87 @@
*/

'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/

'providers' => [

/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,

/*
* Package Service Providers...
*/
Spatie\Permission\PermissionServiceProvider::class,
App\Providers\PluginServiceProvider::class,

/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,

],

'files' => [
// ...
app_path('Plugins/example-plugin/config.php'),
// ...
'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
),
],

/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/

'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
])->toArray(),

// /*
// |--------------------------------------------------------------------------
// | Autoloaded Service Providers
// |--------------------------------------------------------------------------
// |
// | The service providers listed here will be automatically loaded on the
// | request to your application. Feel free to add your own services to
// | this array to grant expanded functionality to your applications.
// |
// */
//
// 'providers' => [
//
// /*
// * Laravel Framework Service Providers...
// */
// Illuminate\Auth\AuthServiceProvider::class,
// Illuminate\Broadcasting\BroadcastServiceProvider::class,
// Illuminate\Bus\BusServiceProvider::class,
// Illuminate\Cache\CacheServiceProvider::class,
// Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
// Illuminate\Cookie\CookieServiceProvider::class,
// Illuminate\Database\DatabaseServiceProvider::class,
// Illuminate\Encryption\EncryptionServiceProvider::class,
// Illuminate\Filesystem\FilesystemServiceProvider::class,
// Illuminate\Foundation\Providers\FoundationServiceProvider::class,
// Illuminate\Hashing\HashServiceProvider::class,
// Illuminate\Mail\MailServiceProvider::class,
// Illuminate\Notifications\NotificationServiceProvider::class,
// Illuminate\Pagination\PaginationServiceProvider::class,
// Illuminate\Pipeline\PipelineServiceProvider::class,
// Illuminate\Queue\QueueServiceProvider::class,
// Illuminate\Redis\RedisServiceProvider::class,
// Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
// Illuminate\Session\SessionServiceProvider::class,
// Illuminate\Translation\TranslationServiceProvider::class,
// Illuminate\Validation\ValidationServiceProvider::class,
// Illuminate\View\ViewServiceProvider::class,
//
// /*
// * Package Service Providers...
// */
// Spatie\Permission\PermissionServiceProvider::class,
// App\Providers\PluginServiceProvider::class,
//
// /*
// * Application Service Providers...
// */
// App\Providers\AppServiceProvider::class,
// App\Providers\AuthServiceProvider::class,
// // App\Providers\BroadcastServiceProvider::class,
// App\Providers\EventServiceProvider::class,
// App\Providers\RouteServiceProvider::class,
//
// ],
//
//
// /*
// |--------------------------------------------------------------------------
// | Class Aliases
// |--------------------------------------------------------------------------
// |
// | This array of class aliases will be reistered when this application
// | is started. However, feel free to register as many as you wish as
// | the aliases are "lazy" loaded so they don't hinder performance.
// |
// */
//
// 'aliases' => Facade::defaultAliases()->merge([
// // 'ExampleClass' => App\Example\ExampleClass::class,
// ])->toArray(),
];
11 changes: 2 additions & 9 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,5 @@
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = $kernel->handle(
$request = Request::capture()
)->send();

$kernel->terminate($request, $response);
(require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture());
4 changes: 3 additions & 1 deletion routes/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

use Illuminate\Support\Facades\Route;

Route::post('/user/notification/read', \App\Http\Controllers\Ajax\User\Notification\ReadWhatsNewController::class)->name('read.news');
Route::prefix('ajax')->name('ajax.')->group(function(){
Route::post('/user/notification/read', App\Http\Controllers\Ajax\User\Notification\ReadWhatsNewController::class)->name('read.news');
});
Loading