NoticeController.php 408 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Http\Controllers\User;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request;
  5. use App\Models\Notice;
  6. use App\Utils\Helper;
  7. class NoticeController extends Controller
  8. {
  9. public function fetch(Request $request)
  10. {
  11. return response([
  12. 'data' => Notice::orderBy('created_at', 'DESC')
  13. ->limit(5)
  14. ->get()
  15. ]);
  16. }
  17. }