定制 laravel-enso/core 二次开发

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

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

laravel-enso/core

Composer 安装命令:

composer require laravel-enso/core

包简介

The backend shell of a Laravel Enso application

README 文档

README

License Stable Downloads PHP Issues Merge Requests

Description

Core is the backend shell of a Laravel Enso application.

It aggregates the packages required for a standard Enso installation, registers the framework-level service providers and middleware stack, exposes the base authentication and SPA endpoints, builds the frontend boot state, manages user preferences, publishes shared assets, registers core mail previews, and provides a handful of operational commands used across Enso projects.

It is the package that turns the rest of the Enso ecosystem into a coherent application runtime.

Installation

This package is intended to be installed as the main backend dependency of an Enso application:

composer require laravel-enso/core

After installation, run the standard setup steps:

php artisan migrate
php artisan db:seed

If you want to publish the package resources, the relevant tags are:

php artisan vendor:publish --tag=core-config
php artisan vendor:publish --tag=core-seeders
php artisan vendor:publish --tag=core-assets

The package automatically:

  • loads API routes
  • loads migrations
  • loads core mail views
  • registers core mail previews through laravel-enso/mails
  • registers Enso service providers
  • configures the Eloquent factory resolver for package models

Features

  • Provides the base Enso API shell, including guest meta, SPA home state, auth routes, and preferences routes.
  • Provides a read-only System > Logins table for login history, with user and datetime interval filtering.
  • Registers the core middleware group used by authenticated Enso routes.
  • Configures password policy defaults from enso.auth.password.
  • Builds the SPA boot state from state providers discovered across Enso packages.
  • Persists per-user global and route-level preferences.
  • Publishes shared image assets.
  • Requires laravel-enso/mails for shared mail layouts, components, and preview registration.
  • Registers reset and set password mail notifications and previews in the shared Enso mail preview catalog through a dedicated MailServiceProvider.
  • Registers operational commands for version reporting, storage resets, preference resets, preference upgrades, and app-update notifications.
  • Integrates login tracking, password reset flows, websocket support, route authorization, localisation, impersonation, and action logging through the wider Enso stack.

Usage

The package exposes the guest meta endpoint:

route('meta');

Authenticated clients bootstrap the SPA state through:

route('core.home.index');

Preferences can be updated per route or globally through:

route('core.preferences.store', ['route' => 'administration.users.index']);
route('core.preferences.reset');

Useful built-in commands:

php artisan enso:version
php artisan enso:preferences:reset
php artisan enso:preferences:update-global
php artisan enso:storage:reset
php artisan enso:announce-app-update

The frontend counterpart for the API shell and shared UI runtime lives in the Enso UI package:

::: warning Note core.home.index does not return a Blade page. It returns the merged state payload produced by the Enso state builder, grouped by frontend store. :::

API

Routes

Guest / auth endpoints:

  • GET /api/meta
  • POST /api/login
  • POST /api/password/email
  • POST /api/password/reset
  • POST /api/logout

Authenticated core endpoints:

  • GET /api/core/home
  • PATCH /api/core/preferences/store/{route?}
  • POST /api/core/preferences/reset/{route?}

Authenticated system login table endpoints:

  • GET /api/system/logins/initTable
  • GET /api/system/logins/tableData
  • GET /api/system/logins/exportExcel

Middleware

Aliases:

  • verify-active-state
  • xss-sanitizer
  • ensure-frontent-requests-are-stateful

core middleware group:

  • VerifyActiveState
  • ActionLogger
  • Impersonate
  • VerifyRouteAccess
  • SetLanguage

State System

State is built through:

  • LaravelEnso\Core\Services\State\Builder
  • LaravelEnso\Core\Services\State\Source

It scans configured vendors from:

  • config('enso.state.vendors')

Built-in state providers include:

  • Meta
  • Preferences
  • Themes
  • Websockets

Preferences

Model:

  • LaravelEnso\Core\Models\Preferences

Capabilities:

  • route-level local preferences
  • global preferences
  • theme updates
  • language updates
  • reset to factory defaults

Commands

  • enso:version (works with a github token, if neccesary)
  • enso:preferences:reset
  • enso:preferences:update-global
  • enso:storage:reset
  • enso:announce-app-update

Events and Notifications

Events:

  • LaravelEnso\Core\Events\Login
  • LaravelEnso\Core\Events\AppUpdate

Notifications:

  • PasswordExpiresSoon
  • ResetPassword
  • SetPassword

Password helpers on the user model:

  • sendResetPasswordEmail()
  • sendSetPasswordEmail()

Login History

Model:

  • LaravelEnso\Core\Models\Login

The package records successful logins and exposes them through the system.logins Enso table. The table includes user, IP, user agent, and login datetime columns. Login history is read-only and supports filtering by user and by created_at interval.

Upgrade support:

  • LaravelEnso\Core\Upgrades\LoginCreatedAtIndex adds the logins.created_at index for existing installations.

Depends On

Required Enso packages:

Framework and external dependencies:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

laravel-enso/core 适用场景与选型建议

laravel-enso/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 65.25k 次下载、GitHub Stars 达 34, 最近一次更新时间为 2017 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 laravel-enso/core 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 65.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 21
  • 依赖项目数: 78
  • 推荐数: 0

GitHub 信息

  • Stars: 34
  • Watchers: 7
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-22