An open API service indexing awesome lists of open source software.

https://github.com/waadmawlood/laravel-duplicated-unique-soft-delete

Deleting unique columns using soft delete is not a recommended method but works in some cases where the data is not important.
https://github.com/waadmawlood/laravel-duplicated-unique-soft-delete

Last synced: 6 months ago
JSON representation

Deleting unique columns using soft delete is not a recommended method but works in some cases where the data is not important.

Awesome Lists containing this project

README

          

![Banner](https://raw.githubusercontent.com/waadmawlood/laravel-duplicated-unique-soft-delete/main/banner/banner.png)

# 📌 Duplicated Unique Soft Delete Package

Deleting unique columns using soft delete is not a recommended method but works in some cases where the data is not important.

 

## 🧔 Authors

- [Waad Mawlood](https://www.github.com/waadmawlood)
- waad_mawlood@outlook.com

 

## 🎈 Mini Requirement

- PHP >= 8.0.0

 

## 💯 Installation

Installation By Composer

```sh
composer require waad/laravel-duplicated-unique-soft-delete
```
 

## 🧰 Usage

In **Model**
```js
'required|string|max:255',
'serial_number' => 'required|string|max:255,
'mac_address' => 'required|string|max:255',
];
}
```

**Instead Of**

```js
public function rules()
{
return [
'name' => 'required|string|max:255',
'serial_number' => 'required|string|max:255|unique:items,serial_number',
'mac_address' => 'required|string|max:255|unique:items,mac_address',
];
}
```

 

## 🎀 Example

- POST method created example
```js
name:Item 3
serial_number:s6
mac_address:m6
```
 

use parameters
```js
name:Item 3
serial_number:s6
mac_address:m6
unique_select_attributes:serial_number
unique_or_operator:1
```

⚠️ when use `unique_or_operator` here will check only `serial_number` and use `or` in checking regardless `mac_address` if exist with `serial_number` in same record

 

## 🎯 License

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)