Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get soft deleted data laravel

To also get soft deleted models : 

$trashedAndNotTrashed = Model::withTrashed()->get();

Only soft deleted models in your results : 

$onlySoftDeleted = Model::onlyTrashed()->get();
Comment

add soft delete deleted by in laravel 8

 	/**
     * Get the name of the "deleted by" column.
     *
     * @return string
     */
    public function getDeletedByColumn()
    {
        return defined('static::DELETED_BY') ? static::DELETED_BY : 'deleted_by';
    }
    
 	protected function runSoftDelete(){
      $columns = [
                  $this->getDeletedAtColumn() => $this->fromDateTime($time),
                  $this->getDeletedByColumn() => Auth::id(),
              ];
 	}
Comment

PREVIOUS NEXT
Code Example
Php :: put img in timestamp using php 
Php :: delete cache laravel 
Php :: wp get term link 
Php :: How to check current URL inside @if statement in Laravel 
Php :: get all pages list from specific template 
Php :: set subject for mail inlaravel 
Php :: Fatal error: Maximum execution time of 120 seconds exceeded in 
Php :: Find ip address location php 
Php :: cakephp 404 exception 
Php :: get domain from subdomain php 
Php :: get hours difference between two dates in php 
Php :: laravel model transaction 
Php :: yii2 redirect back 
Php :: how to define variable as object in blade laravel 
Php :: doument root phpp 
Php :: php delete a folder 
Php :: php multiple line string 
Php :: php string max length 
Php :: phpstan ignore 
Php :: increase the number in php by a certain percentage 
Php :: php array_sum 
Php :: check if value exists in object php 
Php :: check if post id exists wordpress 
Php :: add column in laravel migration cmnd 
Php :: check if input file is set codeigniter 
Php :: laravel word count utf8 
Php :: php switch 2 variables 
Php :: php get content phpinfo without show 
Php :: how to get php version in xampp 
Php :: teruglopende for loop php 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =