1 | <?php namespace Modules\Blog\Http\Controllers\Admin; |
||
12 | class PostController extends AdminBaseController |
||
13 | { |
||
14 | /** |
||
15 | * @var PostRepository |
||
16 | */ |
||
17 | private $post; |
||
18 | /** |
||
19 | * @var CategoryRepository |
||
20 | */ |
||
21 | private $category; |
||
22 | /** |
||
23 | * @var FileRepository |
||
24 | */ |
||
25 | private $file; |
||
26 | /** |
||
27 | * @var Status |
||
28 | */ |
||
29 | private $status; |
||
30 | |||
31 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * Display a listing of the resource. |
||
47 | * |
||
48 | * @return \Illuminate\View\View |
||
49 | */ |
||
50 | public function index() |
||
56 | |||
57 | /** |
||
58 | * Show the form for creating a new resource. |
||
59 | * |
||
60 | * @return \Illuminate\View\View |
||
61 | */ |
||
62 | public function create() |
||
70 | |||
71 | /** |
||
72 | * Store a newly created resource in storage. |
||
73 | * |
||
74 | * @param CreatePostRequest $request |
||
75 | * @return \Illuminate\Http\RedirectResponse |
||
76 | */ |
||
77 | public function store(CreatePostRequest $request) |
||
85 | |||
86 | /** |
||
87 | * Show the form for editing the specified resource. |
||
88 | * |
||
89 | * @param Post $post |
||
90 | * @return \Illuminate\View\View |
||
91 | */ |
||
92 | public function edit(Post $post) |
||
101 | |||
102 | /** |
||
103 | * Update the specified resource in storage. |
||
104 | * |
||
105 | * @param Post $post |
||
106 | * @param UpdatePostRequest $request |
||
107 | * @return \Illuminate\Http\RedirectResponse |
||
108 | */ |
||
109 | public function update(Post $post, UpdatePostRequest $request) |
||
110 | { |
||
111 | $this->post->update($post, $request->all()); |
||
112 | |||
113 | flash(trans('blog::messages.post updated')); |
||
114 | |||
115 | return redirect()->route('admin.blog.post.index'); |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * Remove the specified resource from storage. |
||
120 | * |
||
121 | * @param Post $post |
||
122 | * @return \Illuminate\Http\RedirectResponse |
||
123 | */ |
||
124 | public function destroy(Post $post) |
||
134 | } |
||
135 |