tsyama / laravel-soft-delete-flag
A Laravel package that can use Boolean column for soft deletes.
Installs: 36 896
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- laravel/framework: >=5.7
This package is auto-updated.
Last update: 2024-05-08 10:37:52 UTC
README
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 Tsyama\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';
...