31 lines
634 B
PHP
31 lines
634 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Testing;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Testing\Mailbox;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class TestMailboxController extends Controller
|
|
{
|
|
public function index(): JsonResponse
|
|
{
|
|
abort_unless(app()->environment(['local', 'testing']), 404);
|
|
|
|
return response()->json([
|
|
'data' => Mailbox::all(),
|
|
]);
|
|
}
|
|
|
|
public function destroy(): JsonResponse
|
|
{
|
|
abort_unless(app()->environment(['local', 'testing']), 404);
|
|
|
|
Mailbox::flush();
|
|
|
|
return response()->json([
|
|
'status' => 'ok',
|
|
]);
|
|
}
|
|
}
|