mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 13:17:52 +08:00
commit message
This commit is contained in:
25
app/Http/Controllers/PlanController.php
Executable file
25
app/Http/Controllers/PlanController.php
Executable file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Plan;
|
||||
use App\Models\User;
|
||||
|
||||
class PlanController extends Controller
|
||||
{
|
||||
public function info (Request $request) {
|
||||
if (empty($request->input('plan_id'))) {
|
||||
abort(500, '参数错误');
|
||||
}
|
||||
$plan = Plan::find($request->input('plan_id'));
|
||||
if (!$plan) {
|
||||
abort(500, '该订阅不存在');
|
||||
}
|
||||
$user = User::find($request->session()->get('id'));
|
||||
return response([
|
||||
'data' => $plan
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user