[FONT="]1. Chuẩn bị cơ sở dữ liệu:[/FONT]
[FONT="]Ở đây mình lưu trong file. Bạn có thể download load: laptrinh.laedaily.com/laravel-filemanager/photos/1/file/City.rar[/FONT]
[FONT="]Trong thư mục app bạn tạo thêm 1 thư mục function(tên tùy thích) rùi copy file đó vào đây:[/FONT]
[FONT="]Mở file composer.json trong autoload thêm vào dòng:
[/FONT]
"autoload": {
...
,
"files": [
"app/Functions/City.php"
]
},
[FONT="]Sau đó chạy lệnh:
[/FONT]
[FONT="]Tạo route:
[/FONT]
Route::get('township', 'DemoController@township');
Route::get('ajax/township', 'DemoController@ajaxTownship');
[FONT="]Tạo view township.blade.php có nội dung như sau:
Chèn vào thẻ head 2 thừ viện sau: Còn tiếp - Xem chi tiết bên dưới
[/FONT]
Xem chi tiết hơn vui lòng đến với: laedaily.com/ajax-select-box-chon-tinh-thanh-trong-laravel.html
Copyright © 2017 - Laedaily.com
[FONT="]Ở đây mình lưu trong file. Bạn có thể download load: laptrinh.laedaily.com/laravel-filemanager/photos/1/file/City.rar[/FONT]
[FONT="]Trong thư mục app bạn tạo thêm 1 thư mục function(tên tùy thích) rùi copy file đó vào đây:[/FONT]
[FONT="]Mở file composer.json trong autoload thêm vào dòng:
[/FONT]
"autoload": {
...
,
"files": [
"app/Functions/City.php"
]
},
[FONT="]Sau đó chạy lệnh:
[/FONT]
$ composer dumpautoload |
[/FONT]
Route::get('township', 'DemoController@township');
Route::get('ajax/township', 'DemoController@ajaxTownship');
[FONT="]Tạo view township.blade.php có nội dung như sau:
Chèn vào thẻ head 2 thừ viện sau: Còn tiếp - Xem chi tiết bên dưới
[/FONT]
$ composer dumpautoload |
Copyright © 2017 - Laedaily.com
Sửa lần cuối: