New

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

arkitecht/laravel-nullable

Laravel 5 - Add nullable columns to models
979
Install
composer require arkitecht/laravel-nullable
Latest Version:6.0
PHP:>=5.5.9
Laravel:5 – 13
License:MIT
Last Updated:Aug 18, 2026
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

laragear/meta-model

Let other developers customize your package model and migrations

2,003,720 1
tusimo/embed-relation

a relation for laravel

10,959 3
zae/lara-press

A set of models to use with Laravel's Eloquent to query a Wordpress database.

4,580 4
mammut-alex/polyglot

Translate model column in laravel

1,929 2
illuminatech/db-safedelete

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

37 16

Version History

Version Released PHP Laravel License
6.0 >=5.5.9 >=5 MIT
5.1 >=5.5.9 >=5 MIT
5.0 >=5.5.9 5.*|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
3.0 >=5.5.9 5.*|^6.0|^7.0|^8.0|^9.0 MIT
2.1 >=5.5.9 5.*|^6.0|^7.0|^8.0 MIT