https://getcomposer.org/download/
Link hướng dẫn :https://hocwebchuan.com/tutorial/laravel/install_composer.php
composer -v
https://github.com/barryvdh/laravel-debugbar
Dùng câu lệnh: composer require barryvdh/laravel-debugbar --dev
- Mỗi lần edit .evn nên: composer dump-autoload
public function up() dùng để thêm, bớt, thay đổi, ... nội dung bảng cơ sở dữ liệu - để thực thi ta cần sử dụng lệnh php artisan migrate public function down() dùng phục hồi hay xóa bảng, ... - để thực thi ta cần sử dụng lệnh php artisan migrate:rollback
- cấu hình xong ta chạy php artisan migrate để build database cho toàn bộ các file trong database/migrations/
- trong function down(){ Schema::dropIfExists('table xoá');}
- Dùng php artisan migrate:rollback để chạy down
- Dùng php artisan migrate:refresh để chạy xoá xong chạy tạo db . ta có thể hiểu
=> php artisan migrate:refresh = php artisan migrate:rollback + php artisan migrate.
Lúc này đã có 4 bảng được tạo trong Database myproject:
migrations: chứa dữ liệu của Migration, lưu trữ thông tin các bảng dữ liệu được tạo trong Migration.
password_resets: bảng reset password có sẵn trong thư mục /database/migrations/, đây là table tồn tại sẵn của Laravel
users: bảng user có sẵn trong thư mục /database/migrations/, đây là table tồn tại sẵn của Laravel
php artisan migrate:rollback --path=/database/migrations/your-specific-migration.php
Trong đó: your-specific-migration.php là file (table) cần DROP.
Sử dụng factories:
1.https://onlinewebtutorblog.com/seeder-with-faker-library-concept-in-laravel-8/
USER: minhtrung4367@gmail.com
PASS: Minhtrung0110
NCB - 9704198526191432198 - NGUYEN VAN A - 07/15 - 123456-
trường hợp khi ảnh upload lên nhưng k thấy hiện ra view thì cách fix như sau trong thư mục public xóa thư mục storage (nếu có). sau khi xóa chạy câu lệnh "php artisan storage:link" nếu hiện thông báo đã liên kết thành thì đã fix xong
date ('d-m-Y', strtotime($staff->end_date))