Written by
php-style
on
on
라라벨 09/13
라라벨 09/13
컨트롤러에
$posts = Post::latest()->paginate(10);
blade.php 에
{{ $posts->links() }}
하면 페이지네이션 구현끝~
hasFile('image')
image 라는 파일이 넘어왔나요?? 묻는메서드 컨트롤러에 사용
hasFile('image')확인할때.
if ($request->hasFile('image')) {
dd($request->file('image'));
};
라라벨쪽에서 받음.. -> 서버쪽에 임시 dir 을 씀
public / images ->>>>가
storage-> public / images -->> 요청받음.
public 디스크는 파일을 누구나 접근 가능하다는 것을 의도함.
-->> storage 에 저장된건 못끌어다씀.
php 에서 string concat ---->>>>> . 을씀.
$path = time() . '_' . $path;
처럼.
from http://habbang0.tistory.com/81 by ccl(A) rewrite - 2021-09-13 16:01:06