Skip to content

A Laravel package that can use Boolean column ​​for soft deletes.

License

Notifications You must be signed in to change notification settings

mikeqci/laravel-soft-delete-flag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Attribution This is a direct copy of https://github.com/tsyama/laravel-soft-delete-flag - I only made null be the "not deleted" state, rather than false

laravel-soft-delete-flag

A Laravel package that can use Boolean column ​​for soft deletes.

Installation

You can install this package into your Laravel application using composer.

The recommended way to install composer package is

composer require tsyama/laravel-soft-delete-flag

Usage

1. Use SoftDeleteFlagTrait in your model class

<?php
namespace App;

use Mikeqci\LaravelSoftDeleteFlag\Traits\SoftDeleteFlagTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use SoftDeleteFlagTrait;
...

2. Define a constant and set the column name of the deletion flag

class User extends Model
{
    use SoftDeleteFlagTrait;
    
    const DELETED_AT = 'delete_flag';
...

About

A Laravel package that can use Boolean column ​​for soft deletes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%