Initial commit
This commit is contained in:
21
app/Http/Controllers/Api/LinkController.php
Normal file
21
app/Http/Controllers/Api/LinkController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Models\Link;
|
||||
|
||||
class LinkController extends Controller
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$link = Link::first();
|
||||
$links = $link ? $link->links : [];
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'data' => $links
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user