File Manager Lite
Dir:
/home/u540325668/domains/mccsociety.org/public_html/app/Http/Controllers
Upload
[..]
Admin/
Rename
Del
Auth/
Rename
Del
Author/
Rename
Del
Controller.php (361 B)
Edit
Rename
Del
HomeController.php (651 B)
Edit
Rename
Del
Manager/
Rename
Del
Operator/
Rename
Del
User/
Rename
Del
followController.php (3.57 KB)
Edit
Rename
Del
frontEndController.php (8.05 KB)
Edit
Rename
Del
onlineAdmissionController.php (2.36 KB)
Edit
Rename
Del
pagemgdController.php (4.77 KB)
Edit
Rename
Del
postmgdController.php (3.33 KB)
Edit
Rename
Del
welcomeController.php (3.67 KB)
Edit
Rename
Del
Edit: postmgdController.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Post; use App\Like; use Auth; class postmgdController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function like($id) { if(Auth::check()) { if(Like::where('post_id', $id)->where('user_id', Auth::user()->id )->first()){ $likeid = Like::where('post_id', $id)->where('user_id', Auth::user()->id )->first(); $likedelete = Like::find($likeid->id); $likedelete->delete(); Post::where('id', $id)->decrement('like_id'); $notification = array('message' => 'You Dis Like successfuly', 'alert-type' => 'error' ); return redirect()->back()->with($notification); } $like = new Like(); $like->post_id = $id; $like->user_id = Auth::user()->id; $like->save(); Post::where('id', $id)->increment('like_id'); $notification = array('message' => 'You Like successfuly', 'alert-type' => 'success' ); return redirect()->back()->with($notification); } return redirect('/login'); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function fbook($id) { Post::find($id)->increment('fbook_id'); $postName = Post::where('id', $id)->first(); return redirect()->away('https://www.facebook.com/sharer/sharer.php?u='.url('/postinfo/'.$id.'/'.$postName->postName)); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function down($id) { Post::find($id)->increment('dawn_id'); $file_name = Post::where('id', $id)->first(); $file_path = public_path('/storage/post_img/'.$file_name->postImage); return response()->download($file_path); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function wapp($id) { Post::find($id)->increment('wapp_id'); $postName = Post::where('id', $id)->first(); $singleLine = str_replace(array("\n", "\r"), '', $postName->postDesc); return redirect()->away('whatsapp://send?text='.$singleLine.'%0A %0A'.'More: ShareStall.in/postinfo/'.$id.'/'.'more'); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function twite($id) { Post::find($id)->increment('copy_id'); $postName = Post::where('id', $id)->first(); return redirect()->away('https://twitter.com/intent/tweet?text='.$postName->postName.':&'.url('/postinfo/'.$id.'/'.$postName->postName)); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }
Simpan