PHPackages                             elegantmedia/oxygen-foundation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. elegantmedia/oxygen-foundation

ActiveLibrary[Framework](/categories/framework)

elegantmedia/oxygen-foundation
==============================

Foundation for Oxygen framework projects.

v6.0.1(1mo ago)012.3k↑76.2%4MITPHPPHP ^8.3CI passing

Since Sep 15Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/elegantmedia/oxygen-foundation)[ Packagist](https://packagist.org/packages/elegantmedia/oxygen-foundation)[ Docs](https://github.com/elegantmedia/oxygen-foundation)[ RSS](/packages/elegantmedia-oxygen-foundation/feed)WikiDiscussions 6.x Synced 2d ago

READMEChangelog (10)Dependencies (24)Versions (40)Used By (0)

Oxygen Foundation
=================

[](#oxygen-foundation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/538034023c2b6f18c7c8a7c17cc8a2c0081884c52a4e331c1dec247d973ca652/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6567616e746d656469612f6f787967656e2d666f756e646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegantmedia/oxygen-foundation)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Version Compatibility and Upgrading
-----------------------------------

[](#version-compatibility-and-upgrading)

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

Laravel VersionPackage VersionPHP VersionBranchv136.x^8.36.xv125.x^8.25.xInstall
-------

[](#install)

Install via Composer

```
composer require elegantmedia/oxygen-foundation:^6.0
```

Install the Foundation

```
php artisan oxygen:foundation:install

```

How to use
----------

[](#how-to-use)

Run all extension seeders

```
php artisan oxygen:seed
```

### Available Functions

[](#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

[](#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

[](#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

[](#components)

#### Menu Navigator

[](#menu-navigator)

[Navigation Menu Developer Guide](docs/references/Navigation.md)

### Schema Macros

[](#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
-------

[](#testing)

Run the test suite:

```
composer test
```

### Code Coverage

[](#code-coverage)

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

#### Installing PCOV (Recommended)

[](#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

[](#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
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Copyright (c) Elegant Media.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance90

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~10 days

Total

39

Last Release

53d ago

Major Versions

v1.3.0 → v2.0.02022-02-08

v2.0.3 → v3.0.02023-03-07

3.x-dev → 4.x-dev2023-03-09

v3.0.1 → v5.0.02025-11-14

v5.0.3 → v6.0.02026-04-07

PHP version history (6 changes)v1.0.0PHP ^7.3

v1.3.0PHP ^7.3|^8.0

v2.0.0PHP ^8.0

v3.0.0PHP ^8.1

v5.0.0PHP ^8.2

v6.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/da3702531f01e83fd1f444563b6df50e14033582eec6b5322e440ec206195160?d=identicon)[emediadevops](/maintainers/emediadevops)

---

Top Contributors

[![shanecp](https://avatars.githubusercontent.com/u/1654017?v=4)](https://github.com/shanecp "shanecp (21 commits)")[![nterms](https://avatars.githubusercontent.com/u/1153030?v=4)](https://github.com/nterms "nterms (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/elegantmedia-oxygen-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/elegantmedia-oxygen-foundation/health.svg)](https://phpackages.com/packages/elegantmedia-oxygen-foundation)
```

###  Alternatives

[orchid/platform

Platform for back-office applications, admin panel or CMS your Laravel app.

4.8k2.5M65](/packages/orchid-platform)[anomaly/streams-platform

A domain-driven, code-configured, flat-file application platform for Laravel.

170126.4k81](/packages/anomaly-streams-platform)[streams/core

A domain-driven, code-configured, flat-file application platform for Laravel.

1707.3k10](/packages/streams-core)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)[fusioncms/cms

Core of FusionCMS

431.3k3](/packages/fusioncms-cms)[getcandy/core

GetCandy Laravel e-commerce core functionality.

156.7k3](/packages/getcandy-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
