Download the PHP package ngocnm/laravel_helpers without Composer
On this page you can find all versions of the php package ngocnm/laravel_helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel_helpers
1. Cài đặt
2. Cấu hình với laravel
-
Register Service Provider
-
Thêm
middlewaretrong groupapitrong fileapp/Http/Kernel.php: -
Để publish file config chạy lệnh bên dưới:
-
config/helper.php -
Cấu hình env:
-
Thêm vào config/app.php:
-
Cấu hình trong class
model - Nếu this->app->singleton không hoạt động thì thêm vào Exceptions/Handler:
Mô tả :
type: Kiểu dữ liệu, bao gồm:int,string,doubleinsert: Có được thêm dữ liệu từ request param hay khôngquery_condition: Truy vấn có điều khiệnrequired_when_create: Yêu cầu bắt buộc với validate requestsort: Truy vấnorder by,fulltext_search: Tìm kiếm bằng fulltext search trong mysql-
Lấy tham số từ request:
- Đăng ký với Model:
3. Khai báo trong hàm lấy dữ liệu:
4. Các tham số lấy dữ liệu từ api
select:fields=field_1,field_2,field_3,...where:where=field_1+condition_1,field_2+condition_2,...where_less:where=field_1+condition_1,field_2+condition_2,...where_than:where=field_1+condition_1,field_2+condition_2,...where_not:where_not=field_1+condition_1,field_2+condition_2,...where_in:where_in=field_1+condition_1,field_2+condition_2,...hoặcwhere_in[]=field_1+condition_1,field_2+condition_2&where_in[]=field_2+condition_3,field_3+condition_4limit:limit=30(mặc định là 30)page:page=1(mặc định là 1)ofset:offset=30(mặc định sẽ tính từ tham sốlimitvàpage)order_by:order_by=field_1+desc,field_2+asc,...field_search:field_search=column_search(Trường tìm kiếm, đi kèm vớifield_search)keyword:keyword=something(Từ khóa tìm kiếm, đi kèm vớikeyword)with:with=relashtionship_1+field_1,field_2-relashtionship_2+field_1,field_2
Lưu ý: Để dùng được param with cần khai báo quan hệ trong class Model:
5. Tùy chỉnh
- Tùy chỉnh cấu hình
limit_max,page_max;
6. Tự động pull code , run command trên nhiều server
- Tùy chình tham số
deploytrong fileconfig/helper.php - Thêm ssh key remote giữa các
server mastervà cácserver cluster
7. Log query cho api
-
Cấu hình
env: -
Thêm middleware
api: - Response api sẽ trả về bao gồm tham số
log_query:
8. Cấu hình job Send Message To Slack cho server
-
Cấu hình supervisor:
- Copy đoạn cấu hình:
9. Config Backup Database Command
-
Config secret of mysql on Server:
-
Create folder of backup:
-
Config .env for backup command:
- Command of Backing up database:
All versions of laravel_helpers with dependencies
PHP Build Version
Package Version
Requires
laravel/framework Version
^8.75|^9.0.0|^10.0.0|^11.0.0|^12.0.0|^13.11.2
php Version ^7.3|^8.0
guzzlehttp/guzzle Version ^7.2
ext-json Version *
php Version ^7.3|^8.0
guzzlehttp/guzzle Version ^7.2
ext-json Version *
The package ngocnm/laravel_helpers contains the following files
Loading the files please wait ...