PHP code example of tranzakt / laravel-softdeletesunique

1. Go to this page and download the library: Download tranzakt/laravel-softdeletesunique library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tranzakt / laravel-softdeletesunique example snippets

 php
$table->string('email')->unique();
 php
    public function rules()
    {
        return [
            'email'=>'
 php
    public function rules()
    {
        return [
            'email'=>[
                ' $query->whereNull('deleted_at'))
            ]
        ];
    }
 php
    public function rules()
    {
        return [
            'email'=>[
                ' $query->where('deleted_at_uniqueable', ''))
            ]
        ];
    }
 php
public function up()
{
    Schema::create('table_name', function (Blueprint $table) {
        ...

        $table->string('email');
        $table->softDeletes()->index();
        $table->softDeletesUnique();
        $table->unique(['deleted_at_uniqueable', 'email']);
    });
}