mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update
This commit is contained in:
		
							
								
								
									
										28
									
								
								app/Http/Controllers/Admin/NoticeController.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/Http/Controllers/Admin/NoticeController.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| <?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) | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										17
									
								
								app/Http/Controllers/NoticeController.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								app/Http/Controllers/NoticeController.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Http\Controllers; | ||||
|  | ||||
| use Illuminate\Http\Request; | ||||
| use App\Http\Controllers\Controller; | ||||
| use App\Models\Notice; | ||||
| use App\Utils\Helper; | ||||
|  | ||||
| class NoticeController extends Controller | ||||
| { | ||||
|     public function index (Request $request) { | ||||
|         return response([ | ||||
|             'data' => Notice::orderBy('created_at', 'DESC')->first() | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user