31 lines
783 B
PHP
31 lines
783 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\LaunchpadProject;
|
|
use Illuminate\Http\Request;
|
|
|
|
class LaunchpadApiController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
return response()->json([
|
|
'data' => LaunchpadProject::select('id', 'name', 'symbol', 'slug', 'status', 'banner_url')
|
|
->orderByDesc('created_at')
|
|
->get()
|
|
]);
|
|
}
|
|
|
|
public function show($slug)
|
|
{
|
|
$project = LaunchpadProject::with(['presale', 'tokenomics'])->where('slug', $slug)->first();
|
|
|
|
if (!$project) {
|
|
return response()->json(['error' => 'Project not found'], 404);
|
|
}
|
|
|
|
return response()->json(['data' => $project]);
|
|
}
|
|
}
|