Download the PHP package fereydooni/unixtime without Composer

On this page you can find all versions of the php package fereydooni/unixtime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package unixtime

Laravel UnixTime

Automatically keep Unix timestamp mirrors (e.g. created_at_unix) for every datetime column in your Laravel models. The package detects relevant columns, creates the _unix columns for you, keeps them in sync any time the model is saved/retrieved, and even rewrites orderBy, latest, and oldest calls so they transparently use the faster integer columns.

Why it exists: while building large datasets I found the ORM constantly ordering and filtering on datetime columns, which meant string comparisons or expensive casting. Integer indexes (*_unix) make those same range/ordering queries consistently faster, so this package automates the boring part—adding, filling, and maintaining the mirrored integer fields.

Features

Installation

The service provider is auto-discovered, so no manual registration is required.

Quick Start

  1. Use the trait on your model

  2. Add the Unix columns

    • Existing tables: run the sync command (see below).
    • New migrations: call $table->timestampEquivalents(); at the end of the migration.
  3. Enjoy the new attributes

Adding Columns for Existing Tables

Use the included Artisan command to scan all models that use the trait and create any missing _unix columns.

Common options:

Option Description
--model="App\\Models\\Customer" Limit the sync to one or more fully-qualified models (option may be repeated).
--dry-run Show the pending changes without touching the database.
--backfill After adding the columns, backfill existing rows using the database’s native Unix conversion functions.

Example (specific model with backfill):

Adding Columns in New Migrations

The service provider registers Schema Builder macros so you can add Unix columns directly in migrations.

Need only one column?

Cleanup helper:

Model Configuration

Everything works out-of-the-box, but you can fine-tune behavior with optional properties:

Helper methods:

Query Builder Enhancements

The trait swaps in a custom Eloquent builder so ordering helpers automatically use the _unix columns whenever they exist. This keeps your queries fast without changing call sites.

Testing

Run the package test suite from your app:

License

The Laravel UnixTime package is open-sourced software licensed under the MIT license.


All versions of unixtime with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fereydooni/unixtime contains the following files

Loading the files please wait ...