定制 wyxos/shift-php 二次开发

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

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

wyxos/shift-php

最新稳定版本:v1.1.56

Composer 安装命令:

composer require wyxos/shift-php

包简介

Laravel SDK to integrate and sync tasks with the SHIFT Dashboard.

README 文档

README

Latest Version on Packagist MIT Licensed

A Laravel package for submitting tasks to the SHIFT Dashboard from within your application. It provides a Vue-based UI component plus API endpoints to send issue reports or feature requests directly to your SHIFT project.

Installation

composer require wyxos/shift-php
php artisan install:shift

By default, install:shift now uses the SHIFT browser/device verification flow:

  • Validates APP_ENV and APP_URL
  • Creates a SHIFT install session
  • Prints the verification URL and short code for browser approval
  • Polls until the session is approved or expires
  • Loads the projects you can install into and lets you choose one, or create a new standalone SHIFT project if none exist yet
  • Finalizes the install and writes SHIFT_TOKEN / SHIFT_PROJECT
  • Registers the current app environment for external collaborator lookup
  • Scaffolds App\Services\ShiftCollaboratorResolver when it does not exist
  • Publishes frontend and config files

If SHIFT_TOKEN and SHIFT_PROJECT are already configured, the installer keeps using those values and skips browser verification.

If you need the old raw-token path, run:

php artisan install:shift --manual

Configuration

Add your SHIFT credentials to .env:

SHIFT_TOKEN=your-api-token
SHIFT_PROJECT=your-project-token
SHIFT_URL=https://shift.wyxos.com
SHIFT_COLLABORATORS_RESOLVER=App\Services\ShiftCollaboratorResolver

Optional: publish config to customize routes and middleware.

php artisan vendor:publish --tag=shift

config/shift.php example:

return [
    'token' => env('SHIFT_TOKEN'),
    'project' => env('SHIFT_PROJECT'),
    'url' => env('SHIFT_URL', 'https://shift.wyxos.com'),
    'routes' => [
        'prefix' => 'shift',
        'middleware' => ['web', 'auth'],
    ],
];

Usage

UI Dashboard

After installing, the task submission UI is available at:

/shift

This route uses the default web and auth middleware unless you customize it.

API Endpoints

All endpoints are prefixed by default with /shift/api and require authentication:

  • GET /shift/api/tasks - List tasks
  • POST /shift/api/tasks - Create a new task
  • GET /shift/api/tasks/{id} - View a task
  • PUT /shift/api/tasks/{id} - Update a task

You can interact with them using Laravel's Http facade:

$response = Http::post('/shift/api/tasks', [
    'title' => 'Bug in report form',
    'description' => 'Submit button does not work on mobile.',
]);

When tasks are submitted, the package automatically includes:

  • The authenticated user's name, email, and ID
  • The current environment and application URL

External Collaborators

install:shift registers the current consumer environment with SHIFT, and the package exposes:

  • GET /shift/api/collaborators/external

SHIFT calls this endpoint using the project token to retrieve eligible external users for the selected project environment.

The generated resolver is intentionally permissive only for APP_ENV=local. For every other environment it returns no users until you replace the TODO stub with your app-specific rules.

Testing

Run a test submission with:

php artisan shift:test

This creates a dummy task to verify setup.

Artisan Commands

  • install:shift - Interactive installation
  • install:shift --manual - Manual raw token and project entry
  • shift:test - Submit a test task
  • shift:publish - Manually publish package assets

License

MIT Wyxos. See LICENSE.md for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固