Add site redirects (#552)

* feat(redirects): add redirects to sites

* chore(style): fixed coding style issues

* style: fix php-stan docblocks

* style: pint cleanup

* tests: fixed redirect test suite

* feat: vhosts include additional configs

* fix: use exact location matching

* - add enums
- use queues
- use vhost rather than separate conf files
- vhost formatter
- cleanup

* generate docs

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
Jamie Wood
2025-03-31 16:30:57 +01:00
committed by GitHub
parent 7882d2022c
commit f483f7fdca
53 changed files with 6944 additions and 4495 deletions

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Resources;
use App\Models\Redirect;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin Redirect */
class RedirectResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'site_id' => $this->site_id,
'mode' => $this->mode,
'from' => $this->from,
'to' => $this->to,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}