承接 sheenazien8/hascrudactions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sheenazien8/hascrudactions

Composer 安装命令:

composer require sheenazien8/hascrudactions

包简介

CRUD tirelessly 💤

README 文档

README

Hascrudaction

Latest Version on Packagist Build Status Total Downloads

This package allows you to build a CRUD with tiny Controller and keep the pattern are consitent.

Lifecycles

Method Path Function Repository Function Route Name
GET base_domain/path/ ControllerClass@index RepositoryClass@datatable path.index
GET base_domain/path/create ControllerClass@create ----- path.create
GET base_domain/path/{id} ControllerClass@show ----- path.show
POST base_domain/path/ ControllerClass@store RepositoryClass@create path.store
GET base_domain/path/{id} ControllerClass@edit ----- path.edit
PUT base_domain/path/{id} ControllerClass@update RepositoryClass@update path.update
DELETE base_domain/path/{id} ControllerClass@destroy RepositoryClass@delete path.destroy
DELETE base_domain/bulkDestroy/ ControllerClass@bulkDestroy RepositoryClass@bulkDestroy path.bulkDestroy

Requirements

Installation

You can install the package via composer:

composer require sheenazien8/hascrudactions

Configuration

Laravel Configuration

php artisan vendor:publish --provider="Sheenazien8\Hascrudactions\HascrudactionsServiceProvider"

Register the provider class in config/app.php

"providers" => [
    Sheenazien8\Hascrudactions\HascrudactionsServiceProvider::class,
]

Lumen Configuration

mkdir -p config
cp vendor/sheenazien8/hascrudactions/config/config.php config/config.php

Basic Usage

First, Generate the Hascrud route with php artisan hascrudaction:make Employee this command will be generate a few class and file views, Example.

  • App\Http\Controllers\EmployeeController
  • App\Http\Requests\Employee\.*
  • App\Repositories\EmployeeRepository
  • resources/views/employee/.*

And Setup the datatable.

Install Datatable Package and Setup

Install Composer

composer require yajra/laravel-datatables

Install Assets

yarn add datatables.net-bs4 datatables.net-buttons-bs4

Register datatables.net in resources js and css file

// Js file
require('bootstrap');
require('datatables.net-bs4');
require('datatables.net-buttons-bs4');

// Scss file
@import "~datatables.net-bs4/css/dataTables.bootstrap4.css";
@import "~datatables.net-buttons-bs4/css/buttons.bootstrap4.css";

Compile Assets

yarn dev / watch / prod

Next, you can add the path in routes/web.php, edit file config in config/hascrudactions.php for wrapper blade layouts and javascript views, add Traits HasLaTable in Model Class Employee.

routes/web.php

Route::hascrud('employee');

config/hascrudactions.php

/**
 * Wrapper view, you can adjust static view like footer and header
 * put file in views path
 * layouts:
 * section:
 * javascript:
 */
'wrapper' => [
    'layouts' => 'layouts.app',
    'section' => 'content',
    'javascript' => 'javascript'
]

app/Employee.php

use Sheenazien8\Hascrudactions\Traits\HasLaTable;

class Employee extends Model
{
    use HasLaTable;
    //
}

And the last, you can define what columns you want to display in the index view in resources/views/employee/components/table.blade.php, and then you must define what columns you want to add or edit in the model Employee with $fillable property and form view resources/views/employee/components/form.blade.php, and also you can get the binding data from controller with the $data variable name.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

sheenazien8/hascrudactions 适用场景与选型建议

sheenazien8/hascrudactions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 92 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sheenazien8」 「hascrudactions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 sheenazien8/hascrudactions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sheenazien8/hascrudactions 我们能提供哪些服务?
定制开发 / 二次开发

基于 sheenazien8/hascrudactions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

与 sheenazien8/hascrudactions 相关的其它包

同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:

统计信息

  • 总下载量: 92
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-17