PHP code example of gavinz8 / swoft-soft-delete

1. Go to this page and download the library: Download gavinz8/swoft-soft-delete 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/ */

    

gavinz8 / swoft-soft-delete example snippets



return [
    'name'  => 'Swoft framework 2.0',
    'debug' => env('SWOFT_DEBUG', 1),
    'soft_delete' => [
        'column' => 'deleted_at',
        'ignore' => ['migration']
    ]
];


User::where('id', 1)->delete();
DB:table('user')->where('id', 1)->delete();

User::find(1);
User::where('id', 1)->first();
User::where('id', 1)->get();
Db::from('user a u')->join('role as r', u.id, r.user_id)->where('u.id', 1)->get();