定制 elegantmedia/oxygen-foundation 二次开发

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

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

elegantmedia/oxygen-foundation

Composer 安装命令:

composer require elegantmedia/oxygen-foundation

包简介

Foundation for Oxygen framework projects.

README 文档

README

Latest Version on Packagist Software License

Version Compatibility and Upgrading

If you're upgrading or want to find an older version, please review the CHANGELOG for notable changes and upgrade notes.

Laravel Version Package Version PHP Version Branch
v13 6.x ^8.3 6.x
v12 5.x ^8.2 5.x

Install

Install via Composer

composer require elegantmedia/oxygen-foundation:^6.0

Install the Foundation

php artisan oxygen:foundation:install

How to use

Run all extension seeders

php artisan oxygen:seed

Available Functions

// Check if a feature exists
has_feature('features.name'): bool

// Convert a date to Standard date-time format
standard_datetime($date);

// Convert a date to Standard date format
standard_date($date);

// Convert a date to Standard time format
standard_time($date);

Models

Make a model searchable (Laravel Scout "keyword" engine)

use Laravel\Scout\Searchable;
use Illuminate\Database\Eloquent\Model;

use ElegantMedia\OxygenFoundation\Scout\KeywordSearchable;

class Car extends Model implements KeywordSearchable
{
    use Searchable;

	public function getSearchableFields(): array
	{
		return [
			'make',
			'model',
		];
	}
}

// Usage
// Ensure Scout driver is set to "keyword" (in config/scout.php or at runtime):
// config(['scout.driver' => 'keyword']);
// Then perform a search:
// Car::search('tesla')->get();

Note: The package registers a secure in-database Scout engine under the keyword driver. Implementing getSearchableFields() is required for searchable models.

Database Traits

Add a secure UUID and token to your models with built-in traits:

use Illuminate\Database\Eloquent\Model;
use ElegantMedia\OxygenFoundation\Database\Eloquent\Traits\HasUuid;
use ElegantMedia\OxygenFoundation\Database\Eloquent\Traits\HasSecureToken;

class ApiClient extends Model
{
    use HasUuid;         // Provides a uuid column and route key
    use HasSecureToken;  // Use helper methods to generate secure tokens
}

// Examples:
// $token = ApiClient::generateUniqueToken('token');
// $token = ApiClient::generateTimestampedToken('token');
// $token = ApiClient::generateUrlSafeToken('token');

Deprecated: CreatesUniqueTokens is kept for BC but should be replaced with HasSecureToken.

Components

Menu Navigator

Navigation Menu Developer Guide

Schema Macros

Convenience macros are available on Blueprint once the service provider is loaded:

Schema::create('files', function (Blueprint $table) {
    $table->id();
    $table->file('file'); // adds file-related columns (uuid, name, path, uploaded_by_user_id, etc.)
    $table->timestamps();
});

// Drop them later
Schema::table('files', function (Blueprint $table) {
    $table->dropFile('file');
});

// Location and place helpers
Schema::table('events', function (Blueprint $table) {
    $table->location('venue'); // latitude/longitude + indexes
    $table->place('venue');    // venue/address/city/state/zip/country + location
});

Testing

Run the test suite:

composer test

Code Coverage

To generate code coverage reports, you need to install a coverage driver. We recommend using PCOV for better performance:

Installing PCOV (Recommended)

On macOS with Homebrew:

brew tap shivammathur/extensions
brew install shivammathur/extensions/pcov@8.3

On Ubuntu/Debian:

sudo apt-get install php-pcov

After installation, run tests with coverage:

composer test-coverage-pcov

Alternative: Using Xdebug

If you already have Xdebug installed, you can use it for coverage:

composer test-coverage

Coverage reports will be generated in the build/coverage directory.

Contributing

Please see CONTRIBUTING for details.

License

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

Copyright (c) Elegant Media.

elegantmedia/oxygen-foundation 适用场景与选型建议

elegantmedia/oxygen-foundation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.12k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 09 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 elegantmedia/oxygen-foundation 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-15