mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 08:39:09 +08:00
29 lines
613 B
PHP
29 lines
613 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Requests\Admin\NoticeSave;
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Notice;
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
class NoticeController extends Controller
|
|
{
|
|
public function index (Request $request) {
|
|
return response([
|
|
'data' => Notice::get()
|
|
]);
|
|
}
|
|
|
|
public function save (NoticeSave $request) {
|
|
$data = $request->only([
|
|
'title',
|
|
'content'
|
|
]);
|
|
return response([
|
|
'data' => Notice::create($data)
|
|
]);
|
|
}
|
|
}
|