allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
2026-03-30 14:54:57 +07:00
parent 66aed7c4e8
commit b5e3a778ce
21316 changed files with 2777892 additions and 13 deletions

View File

@@ -0,0 +1,90 @@
<?php
namespace Laravel\LaravelInstaller\Providers;
use Illuminate\Auth\CreatesUserProviders;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
use Laravel\LaravelInstaller\Helpers\UserTechGuard;
use Laravel\LaravelInstaller\Middleware\canInstall;
use Laravel\LaravelInstaller\Middleware\canUpdate;
class LaravelInstallerServiceProvider extends ServiceProvider
{
use CreatesUserProviders;
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
Auth::extend('sessionss', function ($app, $name, $config) {
$provider = $this->createUserProvider($config['provider'] ?? null);
$guard = new UserTechGuard($name, $provider, $app['session.store']);
// When using the remember me functionality of the authentication services we
// will need to be set the encryption instance of the guard, which allows
// secure, encrypted cookie values to get generated for those cookies.
if (method_exists($guard, 'setCookieJar')) {
$guard->setCookieJar($app['cookie']);
}
if (method_exists($guard, 'setDispatcher')) {
$guard->setDispatcher($app['events']);
}
if (method_exists($guard, 'setRequest')) {
$guard->setRequest($app->refresh('request', $guard, 'setRequest'));
}
return $guard;
});
}
/**
* Bootstrap the application events.
*
* @param \Illuminate\Routing\Router $router
*/
public function boot(Router $router)
{
$this->publishFiles();
$this->loadRoutesFrom(__DIR__ . '/../Routes/web.php');
$router->middlewareGroup('install', [canInstall::class]);
$router->middlewareGroup('update', [canUpdate::class]);
}
/**
* Publish config file for the installer.
*
* @return void
*/
protected function publishFiles()
{
$this->publishes([
__DIR__.'/../Config/installer.php' => base_path('config/installer.php'),
], 'laravelinstaller');
$this->publishes([
__DIR__.'/../assets' => public_path('installer'),
], 'laravelinstaller');
$this->publishes([
__DIR__.'/../Views' => base_path('resources/views/vendor/installer'),
], 'laravelinstaller');
$this->publishes([
__DIR__.'/../Lang' => base_path('lang'),
], 'laravelinstaller');
}
}