Refresh
This commit is contained in:
24
app/Providers/AppServiceProvider.php
Executable file
24
app/Providers/AppServiceProvider.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
// Illuminate\Support\Facades\File;
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
}
|
||||
}
|
||||
16
app/Providers/AuthServiceProvider.php
Executable file
16
app/Providers/AuthServiceProvider.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
}
|
||||
}
|
||||
39
app/Providers/BladeServiceProvider.php
Executable file
39
app/Providers/BladeServiceProvider.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BladeServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerHighlights();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register user's highlights into view.
|
||||
*/
|
||||
protected function registerHighlights()
|
||||
{
|
||||
view()->composer('*', function ($view) {
|
||||
if (!auth()->check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$highlights = auth()->user()->highlights()->select(['id', 'expression', 'color', 'position'])->orderBy('position')->get();
|
||||
|
||||
view()->share('highlights', $highlights);
|
||||
});
|
||||
}
|
||||
}
|
||||
19
app/Providers/BroadcastServiceProvider.php
Executable file
19
app/Providers/BroadcastServiceProvider.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
30
app/Providers/EventServiceProvider.php
Executable file
30
app/Providers/EventServiceProvider.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
}
|
||||
51
app/Providers/FortifyServiceProvider.php
Executable file
51
app/Providers/FortifyServiceProvider.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Actions\Fortify\CreateNewUser;
|
||||
use App\Actions\Fortify\ResetUserPassword;
|
||||
use App\Actions\Fortify\UpdateUserPassword;
|
||||
use App\Actions\Fortify\UpdateUserProfileInformation;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Fortify\Fortify;
|
||||
|
||||
class FortifyServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Fortify::createUsersUsing(CreateNewUser::class);
|
||||
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
|
||||
Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);
|
||||
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
|
||||
|
||||
Fortify::loginView(function () {
|
||||
return view('auth.login');
|
||||
});
|
||||
|
||||
Fortify::registerView(function () {
|
||||
return view('auth.register');
|
||||
});
|
||||
|
||||
Fortify::requestPasswordResetLinkView(function () {
|
||||
return view('auth.forgot-password');
|
||||
});
|
||||
|
||||
Fortify::resetPasswordView(function ($request) {
|
||||
return view('auth.reset-password', ['request' => $request]);
|
||||
});
|
||||
|
||||
Fortify::verifyEmailView(function () {
|
||||
return view('auth.verify-email');
|
||||
});
|
||||
}
|
||||
}
|
||||
35
app/Providers/LangServiceProvider.php
Executable file
35
app/Providers/LangServiceProvider.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class LangServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
view()->composer('*', function ($view) {
|
||||
$strings = '';
|
||||
|
||||
if (auth()->check()) {
|
||||
$langFile = resource_path(sprintf('lang/%s.json', auth()->user()->lang));
|
||||
|
||||
if (file_exists($langFile)) {
|
||||
$strings = json_decode(file_get_contents($langFile));
|
||||
}
|
||||
}
|
||||
|
||||
view()->share('langStrings', $strings);
|
||||
});
|
||||
}
|
||||
}
|
||||
39
app/Providers/ObserversServiceProvider.php
Executable file
39
app/Providers/ObserversServiceProvider.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\Document;
|
||||
use App\Models\Feed;
|
||||
use App\Models\FeedItem;
|
||||
use App\Models\Folder;
|
||||
use App\Models\Group;
|
||||
use App\Models\IgnoredFeed;
|
||||
use App\Models\Observers\BookmarkObserver;
|
||||
use App\Models\Observers\DocumentObserver;
|
||||
use App\Models\Observers\FeedItemObserver;
|
||||
use App\Models\Observers\FeedObserver;
|
||||
use App\Models\Observers\FolderObserver;
|
||||
use App\Models\Observers\GroupObserver;
|
||||
use App\Models\Observers\IgnoredFeedObserver;
|
||||
use App\Models\Observers\UserObserver;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ObserversServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
User::observe(UserObserver::class);
|
||||
Document::observe(DocumentObserver::class);
|
||||
Feed::observe(FeedObserver::class);
|
||||
Folder::observe(FolderObserver::class);
|
||||
Bookmark::observe(BookmarkObserver::class);
|
||||
IgnoredFeed::observe(IgnoredFeedObserver::class);
|
||||
Group::observe(GroupObserver::class);
|
||||
FeedItem::observe(FeedItemObserver::class);
|
||||
}
|
||||
}
|
||||
67
app/Providers/RouteServiceProvider.php
Executable file
67
app/Providers/RouteServiceProvider.php
Executable file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/';
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user