Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

softDelete laravel

Namespace: use IlluminateDatabaseEloquentSoftDeletes; ->in modal
Invoking : use SoftDeletes; -> in modal
php artisan make:migration add_deleted_at_to_contacts_table
Creating a softdelete column : $table->softDeletes(); -> add_deleted_at_to_contacts_table.php

Other Important function
withTashed()->delete or nonDelete(for restore method and forcDelete method)
onlyTrashed()->delete(for view)
restore()
forceDelete()
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #softDelete #laravel
ADD COMMENT
Topic
Name
6+7 =