Skip to content

almost complete function#8

Open
minhquanghapo wants to merge 2 commits intoemailvfrom
develop
Open

almost complete function#8
minhquanghapo wants to merge 2 commits intoemailvfrom
develop

Conversation

@minhquanghapo
Copy link
Owner

No description provided.

'date_format' => 'Hay nhap dung dinh dang',
'max' => 'Nhap it thoi',
'min' => ':attribute too short'
]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate ra hẳn file riêng đi em

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cái validate này của em phải dùng thêm cả cái thằng Student nữa mà.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ừ thế thì mới viết ra file request

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok anh chỗ này em sẽ chú ý.

->select('students.*')->paginate(5);
if($student && $student->count() >0){
return view('admin.student.list', ['data' => $student]);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Mặc định là lây tất cả thì cần gì phải select
  • Nếu muốn kiểm tra số lượng bản ghi lấy được thì kiểm tra bên view ý

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em thừa cái select đó. Xử lý bên view là sao hả anh. Sao lại xử lý bên view() nên dùng controller chứ nhỉ. mà cái này em kiểm tra có hay ko để còn trả về message mà

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bên view mình kiểm tra @if( $student->count() >0) thì in ra kết quả tìm kiếm còn @else thì in ra mesage là không có

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em nghĩ là cái thao tác tính toán nào mà thực hiện được ở controller thì làm ở controller chứ. Sao cái này lại làm ở view được. ví dụ em giả sử em muốn redirect sang một route khác thì sao.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments