����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.145.109.97 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/bofirmacademy.com/app/Http/Controllers/Common/ |
Upload File : |
<?php namespace App\Http\Controllers\Common; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class FollowController extends Controller { public function follow(Request $request) { if (auth()->id() != $request->id) { auth()->user()->followings()->syncWithoutDetaching([$request->id => ['created_at' => now()]]); $msg = __("Follow successfully"); $status = 200; } else{ $msg = __("You can not follow yourself"); $status = 403; } $response['msg'] = $msg; $response['status'] = $status; return response()->json($response, $status); } public function unfollow(Request $request) { if (auth()->id() != $request->id) { auth()->user()->followings()->detach($request->id); $msg = __("unFollow successfully"); $status = 200; } else{ $msg = __("You can not unfollow yourself"); $status = 403; } $response['msg'] = $msg; $response['status'] = $status; return response()->json($response, $status); } }