Email integration: IMAP polling via webklex/php-imap (M365/Zoho/MIAB
compatible), TicketEmailProcessor with 3-strategy ticket matching
(In-Reply-To, References, subject line [EZSCALE-{id}]), signature and
quote stripping, scheduled command every 2min.
Outbound: 4 notification classes (TicketCreated, CustomerReply,
StaffReply, StatusChanged) with email threading headers via
withSymfonyMessage(). Staff replies set Reply-To: support@ezscale.cloud.
Frontend: ticket reference chips on all pages, "Via Email" badges on
email-originated replies. 12 new tests (163 total, 816 assertions).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Http\Responses\LoginResponse;
|
|
use App\Http\Responses\RegisterResponse;
|
|
use App\Services\Billing\BillingServiceFactory;
|
|
use App\Services\Provisioning\ProvisioningFactory;
|
|
use Illuminate\Cache\RateLimiting\Limit;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\RateLimiter;
|
|
use Illuminate\Support\Facades\URL;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;
|
|
use Laravel\Fortify\Contracts\RegisterResponse as RegisterResponseContract;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(LoginResponseContract::class, LoginResponse::class);
|
|
$this->app->singleton(RegisterResponseContract::class, RegisterResponse::class);
|
|
$this->app->singleton(BillingServiceFactory::class);
|
|
$this->app->singleton(ProvisioningFactory::class);
|
|
$this->app->bind(
|
|
\App\Services\Tickets\EmailServiceInterface::class,
|
|
\App\Services\Tickets\ImapEmailService::class
|
|
);
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
if ($this->app->environment('production', 'local')) {
|
|
URL::forceScheme('https');
|
|
}
|
|
|
|
RateLimiter::for('api', function (Request $request) {
|
|
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
|
});
|
|
|
|
RateLimiter::for('register', function (Request $request) {
|
|
return Limit::perMinute(3)->by($request->ip());
|
|
});
|
|
}
|
|
}
|