Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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(),
              ];
 	}
 
PREVIOUS NEXT
Tagged: #add #soft #delete #deleted #laravel
ADD COMMENT
Topic
Name
8+6 =