New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

lukaskorl/uniquely

Uniquely identified models for Laravel 4 by using UUID as primary key
2,008 1

Larablocks Analysis

lukaskorl/uniquely works with Laravel 4 (latest release v1.0, Jul 26, 2014), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4, past end of life
  • No release in the last 12 months (last: Jul 26, 2014)
  • 0 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 26, 2014.
  • No releases in the last 12 months.
  • First released: Jun 9, 2014.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.

Install
composer require lukaskorl/uniquely
Latest Version:v1.0
PHP:>=5.4.0
Laravel:4
License:MIT
Last Updated:Jul 26, 2014
Links: GitHub  ·  Packagist
Maintainer: lukaskorl

Uniquely identified models for Laravel 4

Uniquely uses UUIDv4 as primary key for Laravel 4 Eloquent models. It automatically generates the UUID when your model is saved. Uniquely overwrites the save() method instead of attaching to Eloquent's creating event in order to circumvent some problems in combination with unit testing.

Installation

To install Uniquely run

$ composer require lukaskorl/uniquely

You can specify 1.* to include the most current version including possible future bugfixes.

Manual installation

If you choose to install Uniquely manually add the following line to your composer.json:

"require": {
    "lukaskorl/uniquely": "1.*"
}

and run

$ composer update

to install the package.

Usage

To use a Uniquely model simply extend your model class from Lukaskorl\Uniquely\Model.

<?php

use Lukaskorl\Uniquely\Model;

class User extends Model {

}

Proper database migrations

The id field of the corresponding database table for your model should be a 36-char string (i.e. VARCHAR(36)). If you are using Laravel 4 migrations you will have to set your id field like so:

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUsersTable extends Migration {

	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
			$table->string('id', 36);
			// ... other columns ...
			$table->timestamps();
		});

        Schema::table('users', function(Blueprint $table)
        {
            $table->primary('id');
        });
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}
}

License

Uniquely is open-sourced software licensed under the MIT license.

Related Packages

dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

3,631,957 483
xzxzyzyz/laravel-uuid-model

Uuid Model For Laravel

3,078 0
garethnic/unique

A Laravel package to make uuid fields in a database table

8 3
mindtwo/laravel-auto-create-uuid

Automatically generate UUIDs for Eloquent models on creation and replication.

33,459 1
stevenmaguire/laravel-uuid-model

Create non-incrementing Laravel models whose primary key is a UUID

46 4

Version History

Version Released PHP Laravel License
v1.0 >=5.4.0 4.2.* MIT
v0.3 >=5.4.0 4.2.* MIT
v0.2 >=5.4.0 4.2.* MIT
v0.1 >=5.4.0 4.2.* MIT