PHP code example of snowrunescape / eloquent-softdeletes

1. Go to this page and download the library: Download snowrunescape/eloquent-softdeletes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

snowrunescape / eloquent-softdeletes example snippets


use Illuminate\Database\Eloquent\Model;
use SnowRunescape\SoftDeletes\SoftDeletes;

class YourModel extends Model
{
    use SoftDeletes;
}

$model->delete();

$model->restore();

$allRecords = YourModel::withTrashed()->get();

$deletedRecords = YourModel::onlyTrashed()->get();

$activeRecords = YourModel::withoutTrashed()->get();