arkitecht/laravel-nullable

Laravel 5 - Add nullable columns to models
960
Install
composer require arkitecht/laravel-nullable
Latest Version:5.1
PHP:>=5.5.9
License:MIT
Last Updated:Jul 8, 2024
Links: GitHub  ·  Packagist
Maintainer: Arkitecht

Laravel Nullable

Easily set model columns as nullable - to send null on insert and update when empty. For use when using foreign key, nullable, columns.

Quick Installation

You can install the package most easily through composer

composer require arkitecht/laravel-nullable

Using it in your model

Use the $nullable variable to define the nullable columns in your model. These will send null to the database when empty, rather than an empty string.

<?php

namespace App;

use Arkitecht\Nullable\Traits\Nullable;
use Illuminate\Database\Eloquent\Model;

class Test extends Model
{
    use Nullable;
    protected $nullable = ['null_column_one','null_column_two'...];
}
?>

Related Packages

illuminatech/db-safedelete

Attempts to invoke force delete, if it fails - falls back to soft delete.

37 16
ort-interactive-gmbh/laravel-couchbase

A Couchbase based Eloquent model and Query builder for Laravel

348 41
arkitecht/laravel-attributions

Laravel 5 - Track attributions (model creator / updater)

13,504 4
jaschweder/laravel-sqlanywhere

A Sybase driver based Eloquent model and Query builder for Laravel 4

490 0
nicolaslopezj/searchable

Eloquent model search trait.

2,916,939 1,998