31 lines
577 B
PHP
31 lines
577 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Throwable;
|
|
|
|
use function Sentry\captureException;
|
|
|
|
abstract class HashidActionControllerBase extends Controller
|
|
{
|
|
protected ?int $key = null;
|
|
|
|
protected ?string $hashid = null;
|
|
|
|
public function __invoke()
|
|
{
|
|
$this->hashid = request('hashid');
|
|
|
|
try {
|
|
$this->key = unhash_it($this->hashid);
|
|
} catch (Throwable $exception) {
|
|
captureException($exception);
|
|
abort(404);
|
|
}
|
|
|
|
return $this->handle();
|
|
}
|
|
|
|
abstract protected function handle();
|
|
}
|