定制 saidabdulsalam/laravel-memo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

saidabdulsalam/laravel-memo

Composer 安装命令:

composer require saidabdulsalam/laravel-memo

包简介

A Laravel package for managing memos

README 文档

README

A configurable Laravel package for managing memos, designed to be integrated into existing Laravel applications.

Table of Contents

Installation

Install the package using Composer:

composer require saidabdulsalam/laravel-memo

Publish the configuration file:

php artisan vendor:publish --tag=memo-config

Run the database migrations:

php artisan migrate

Configuration

The configuration file (config/memo.php) allows you to customize the package to fit your application's needs.

Option Type Default Description
pagination_length Integer 15 The number of memos to display per page.
members_models Array [App\User::class] An array of models to be used for users/members.
office_model Array [App\Office::class] The model to be used for offices.
name Array ['full_name'] The column name(s) to be used for the user's full name.
department_model String App\Models\Department::class The model to be used for departments.
role_column_name String 'role_id' The column name on the user model that stores the user's role.
user_department_id_column String 'department_id' The column name on the user model that stores the user's department ID.
user_office_id_column String 'office_id' The column name on the user model that stores the user's office ID.
members_models_filters Array null An array of filters to apply when fetching members (e.g., [['type' => 'staff']]).
load_routes Boolean true Whether to load the package's routes automatically.

Load Routes with Helper

To load the routes automatically, you can use the memoRoutes() helper function:

memoRoutes();

API Endpoints

All endpoints are prefixed with /memo.

Method URI Action Description
GET /boot boot Fetches initial data for the frontend.
GET /all index Fetches a paginated list of memos.
POST / createOrUpdateMemo Creates or updates a memo.
GET /statuses memoStatus Fetches the available memo statuses.
GET /types memoTypes Fetches the available memo types.
GET /members members Fetches the list of members/users.
POST /reject rejectMemo Rejects a memo.
POST /approve approveMemo Approves a memo.
POST /make_comment saveComment Adds a comment to a memo.
PUT /comment/{id} updateComment Updates a comment.
DELETE /comment/{id} deleteComment Deletes a comment.
GET /departments departments Fetches the list of departments.
DELETE /{id} deleteMemo Deletes a memo.

Events

The package fires the following events:

  • MemoApproved
  • MemoComment
  • MemoCreated
  • MemoRejected
  • MemoUpdated

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-10-04