Linux sg77.dns-private.com 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
LiteSpeed
Server IP : 135.181.230.13 & Your IP : 216.73.217.64
Domains :
Cant Read [ /etc/named.conf ]
User : pilasate
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
pilasate /
pilasa-core /
app /
Http /
Controllers /
Delete
Unzip
Name
Size
Permission
Date
Action
Auth
[ DIR ]
drwxr-xr-x
2024-04-21 07:39
AboutController.php
6.3
KB
-rw-r--r--
2018-10-11 22:20
AdminController.php
547
B
-rw-r--r--
2017-08-23 13:44
AdminManageUserController.php
6.72
KB
-rw-r--r--
2017-08-28 22:04
AdminPostController.php
8.95
KB
-rw-r--r--
2017-09-03 04:35
AdminProfileController.php
3.63
KB
-rw-r--r--
2017-09-13 00:37
BlogController.php
2.06
KB
-rw-r--r--
2017-08-25 15:44
CategoryController.php
4.01
KB
-rw-r--r--
2017-08-25 15:38
CommentsController.php
3.56
KB
-rw-r--r--
2017-09-08 11:38
Controller.php
361
B
-rw-r--r--
2017-07-11 04:08
CustomerController.php
1.48
KB
-rw-r--r--
2017-08-10 01:29
GalleryController.php
4
KB
-rw-r--r--
2017-08-28 15:51
HomeController.php
640
B
-rw-r--r--
2017-08-25 15:31
HostingOrderController.php
3.26
KB
-rw-r--r--
2018-03-28 06:48
LogoController.php
3.5
KB
-rw-r--r--
2018-02-18 04:17
MessagesController.php
2.63
KB
-rw-r--r--
2017-09-18 01:33
PagesController.php
2.92
KB
-rw-r--r--
2018-10-05 00:09
PortfolioController.php
4.97
KB
-rw-r--r--
2017-08-28 17:43
PostController.php
6.48
KB
-rw-r--r--
2018-02-18 04:18
ProfileController.php
4.18
KB
-rw-r--r--
2017-08-27 07:16
ServiceController.php
5.69
KB
-rw-r--r--
2018-10-05 00:06
TagController.php
3.33
KB
-rw-r--r--
2017-08-25 18:01
TeamController.php
4.69
KB
-rw-r--r--
2017-08-28 17:45
VideoController.php
3.16
KB
-rw-r--r--
2017-09-08 23:38
Save
Rename
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\URL; use App\Post; use App\Category; use App\Tag; use Session; use Purifier; use Image; use Storage; use App\User; use Auth; use App\Logo; class PostController extends Controller { public function __construct(){ $this->middleware('auth'); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // create a variable and store all the blog posts in it from the database $posts = Post::orderBy('id','desc')->paginate(5); $categories =Category::all(); $users=Auth::user()->id; $images=Logo::all(); // return a view and pass in the above variable return view('posts.index')->withPosts($posts)->withCategories($categories)->withUsers($users)->withImages($images); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $categories= Category::all(); $tags =Tag::all(); $users=Auth::user()->id; $images=Logo::all(); return view('posts.create')->withCategories($categories)->withTags($tags)->withUsers($users)->withImages($images); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // validate the data $this->validate($request,array( 'title' =>'required|max:255', 'slug' =>'required|alpha_dash|min:5|max:255|unique:posts,slug', 'category_id'=>'required|integer', 'body'=>'required', 'post_image'=>'sometimes|image' )); // store in the database $post = new Post; $post->title = $request->title; $post->slug=$request->slug; $post->category_id = $request->category_id; $post->body =Purifier::clean($request->body); $post->user_id=Auth::user()->id; //save our iamge file if ($request->hasFile('post_image')) { $image= $request->file('post_image'); $filename= time(). '.'. $image->getClientOriginalName();//or we can use encode('png') or somthing like that $location= 'images/'.$filename; Image::make($image)->resize(800,400)->save($location); $post->image=$filename; $post->save(); } $post->save(); $post->tags()->sync($request->tags,false); Session::flash('success','The post was successfully saved!'); // redirect to another page return redirect()->route('posts.index'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $images=Logo::all(); $categories=Category::all(); $posts= Post::find($id); return view('posts.show')->withPosts($posts)->withCategories($categories)->withImages($images); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { //find the post in the database and save as a variable $post =Post::find($id); $categories= Category::all(); $images=Logo::all(); $cats =array(); foreach ($categories as $category) { $cats[$category->id]=$category->name; } $tags= Tag::all(); $tags2=array(); foreach ($tags as $tag) { $tags2[$tag->id]=$tag->name; } // return the view and pass in the variable we previously created return view('posts.edit')->withPost($post)->withCategories($cats)->withTags($tags2)->withImages($images); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { //validate the data $post=Post::find($id); $this->validate($request,array( 'title' =>'required|max:255', 'slug' =>"required|alpha_dash|min:5|max:255|unique:posts,slug,$id", 'category_id' =>'required|integer', 'body' =>'required', 'post_image'=>'image' )); // Save the data to the database $post = Post::find($id); $post->title=$request->input('title'); $post->slug =$request->input('slug'); $post->category_id= $request->input('category_id'); $post->body =Purifier::clean($request->input('body')); if ($request->hasFile('post_image')) { //add the new photo $image= $request->file('post_image'); $filename= time(). '.'. $image->getClientOriginalExtension();//or we can use encode('png') or somthing like that $location= 'images/'.$filename; Image::make($image)->resize(800,400)->save($location); $oldFilename=$post->image; // update the database $post->image=$filename; //Delete the old photo Storage::delete($oldFilename); } $post->save(); if(isset($request->tags)){ $post->tags()->sync($request->tags); } else{ $post->tags()->sync(array()); } //Set flash data with flash message Session::flash('success','This post was successfully updated!'); // redirect with flash data to posts.show return redirect()->route('posts.show',$post->id); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $post=Post::find($id); $post->tags()->detach(); Storage::delete($post->image); $post->delete(); Session::flash('success','The post was successfully deleted!'); return redirect()->route('posts.index'); } }