public function user($slug) { $service = new PostService(); $posts = $service->getPosts($slug); $user = User::where('slug', $slug)->first()->toArray(); $path = '/user/' . $user['slug']; return view('blog.index', compact('posts', 'path', 'user')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(PostService $postService) { $postService->create($all); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(PostService $postService) { $postService->create($request->all()); }
public function getPhoto(Server $server, Request $request, $id, $file) { return PostService::getPhoto($server, $request, $id, $file); }