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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #softDelete #laravel
ADD COMMENT
Topic
Name
4+3 =