app/Post.php
/**
     * Scope for retrieve only not deleted element
     * @param $query
     * @return mixed
     */
Scope for retrieve only not deleted element
@param $query
@return mixed
Scope for retrieve only not deleted element @param $query @return mixed
public function scopeActive($query)
    {
        return $query->where('status', '<>', 'deleted');
    }
public function scopeActive ( $ query ) { return $ query -> where ( 'status' , '<>' , 'deleted' ) ; }
Scope for retrieve only not deleted element
 @param $query
 @return mixed
Scope for retrieve only not deleted element @param $query @return mixed