54 | 55 | {{ $post->category->name }} 56 | 57 |
58 |59 | 60 | {{ $post->title }} 61 | 62 |
63 |70 | No results found for query {{ request()->query('search') }} 71 |
72 | @endforelse 73 | 74 |└── cms
├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── app
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ └── VerificationController.php
│ │ ├── Blog
│ │ │ └── PostsController.php
│ │ ├── CategoriesController.php
│ │ ├── Controller.php
│ │ ├── HomeController.php
│ │ ├── PostsController.php
│ │ ├── TagsController.php
│ │ ├── UsersController.php
│ │ └── WelcomController.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ ├── VerifyCategoriesCount.php
│ │ ├── VerifyCsrfToken.php
│ │ └── verifyIsAdmin.php
│ └── Requests
│ │ ├── Categories
│ │ ├── CreateCategoryRequest.php
│ │ └── UpdateCategoriesRequest.php
│ │ ├── Tags
│ │ ├── CreateTagRequest.php
│ │ └── UpdateTagsRequest.php
│ │ ├── Users
│ │ └── UpdateProfileRequest.php
│ │ └── posts
│ │ ├── CreatePostsRequest.php
│ │ └── UpdatePostRequest.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Tag.php
├── User.php
├── category.php
└── post.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── database.php
├── filesystems.php
├── hashing.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2020_04_05_162508_create_categories_table.php
│ ├── 2020_04_26_120252_create_tags_table.php
│ ├── 2020_04_26_195800_create_post_tag_table.php
│ ├── 2020_04_27_162329_create_posts_table.php
│ └── 2020_04_28_122643_add_soft_delete_to_posts_table.php
└── seeds
│ ├── DatabaseSeeder.php
│ ├── PostTableSeeder.php
│ └── UsersTableSeeder.php
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ ├── app.css
│ ├── page.min.css
│ └── style.css
├── favicon.ico
├── fonts
│ ├── FontAwesome.otf
│ ├── et-line.eot
│ ├── et-line.svg
│ ├── et-line.ttf
│ ├── et-line.woff
│ ├── fa-brands-400.eot
│ ├── fa-brands-400.svg
│ ├── fa-brands-400.ttf
│ ├── fa-brands-400.woff
│ ├── fa-brands-400.woff2
│ ├── fa-regular-400.eot
│ ├── fa-regular-400.svg
│ ├── fa-regular-400.ttf
│ ├── fa-regular-400.woff
│ ├── fa-regular-400.woff2
│ ├── fa-solid-900.eot
│ ├── fa-solid-900.svg
│ ├── fa-solid-900.ttf
│ ├── fa-solid-900.woff
│ ├── fa-solid-900.woff2
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ ├── themify.eot
│ ├── themify.svg
│ ├── themify.ttf
│ └── themify.woff
├── img
│ ├── apple-touch-icon.png
│ ├── favicon.png
│ ├── logo-dark.png
│ └── logo-light.png
├── index.php
├── js
│ ├── app.js
│ ├── page.min.js
│ └── script.js
├── robots.txt
└── web.config
├── readme.md
├── resources
├── js
│ ├── app.js
│ ├── bootstrap.js
│ └── components
│ │ └── ExampleComponent.vue
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ └── app.scss
└── views
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── blog
│ ├── category.blade.php
│ ├── show.blade.php
│ └── tag.blade.php
│ ├── categories
│ ├── create.blade.php
│ └── index.blade.php
│ ├── home.blade.php
│ ├── layouts
│ ├── app.blade.php
│ └── blog.blade.php
│ ├── partials
│ ├── errors.blade.php
│ └── sidebar.blade.php
│ ├── posts
│ ├── create.blade.php
│ └── index.blade.php
│ ├── tags
│ ├── create.blade.php
│ └── index.blade.php
│ ├── users
│ ├── edit.blade.php
│ └── index.blade.php
│ ├── vendor
│ └── pagination
│ │ ├── bootstrap-4.blade.php
│ │ ├── default.blade.php
│ │ ├── semantic-ui.blade.php
│ │ ├── simple-bootstrap-4.blade.php
│ │ └── simple-default.blade.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/cms/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/cms/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=homestead
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | AWS_ACCESS_KEY_ID=
34 | AWS_SECRET_ACCESS_KEY=
35 |
36 | PUSHER_APP_ID=
37 | PUSHER_APP_KEY=
38 | PUSHER_APP_SECRET=
39 | PUSHER_APP_CLUSTER=mt1
40 |
41 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
42 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
43 |
--------------------------------------------------------------------------------
/cms/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/cms/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .phpunit.result.cache
8 | Homestead.json
9 | Homestead.yaml
10 | npm-debug.log
11 | yarn-error.log
12 | /theme
--------------------------------------------------------------------------------
/cms/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/cms/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => ['required', 'string', 'max:255'],
53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54 | 'password' => ['required', 'string', 'min:8', 'confirmed'],
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return \App\User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'name' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => Hash::make($data['password']),
70 | ]);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | $this->middleware('signed')->only('verify');
39 | $this->middleware('throttle:6,1')->only('verify', 'resend');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Blog/PostsController.php:
--------------------------------------------------------------------------------
1 | with('post', $post);
20 | }
21 |
22 | public function category(Category $category)
23 | {
24 | // $search = request()->query('search');
25 |
26 | // if ($search) {
27 | // $posts = $category->posts()->where('title', 'LIKE', "%($search)%")->simplePaginate(2);
28 | // } else {
29 | // $posts = $category->posts()->simplePaginate(2);
30 | // }
31 |
32 |
33 | return view('blog.category')
34 | ->with('category', $category)
35 | ->with('posts', $category->posts()->searched()->simplePaginate(2))
36 | ->with('categories', Category::all())
37 | ->with('tags', Tag::all());
38 | }
39 |
40 | public function tag (Tag $tag)
41 | {
42 | return view ('blog.tag')
43 | ->with('tag',$tag)
44 | ->with('categories', Category::all())
45 | ->with('tags', Tag::all())
46 | ->with('posts', $tag->posts()->searched()->simplePaginate(2));
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/CategoriesController.php:
--------------------------------------------------------------------------------
1 | with('categories', Category::all());
23 | }
24 |
25 | /**
26 | * Show the form for creating a new resource.
27 | *
28 | * @return \Illuminate\Http\Response
29 | */
30 | public function create()
31 | {
32 | return view ('categories.create');
33 | }
34 |
35 | /**
36 | * Store a newly created resource in storage.
37 | *
38 | * @param \Illuminate\Http\Request $request
39 | * @return \Illuminate\Http\Response
40 | */
41 | public function store(CreateCategoryRequest $request)
42 | {
43 | $this->validate($request, [
44 | 'name'=> 'required|unique:categories'
45 | ]);
46 |
47 | Category::create([
48 |
49 | 'name'=> $request->name
50 | ]);
51 |
52 | session()->flash('success', 'category created successfully.');
53 |
54 | return redirect(route('categories.index'));
55 | }
56 |
57 | /**
58 | * Display the specified resource.
59 | *
60 | * @param int $id
61 | * @return \Illuminate\Http\Response
62 | */
63 | public function show($id)
64 | {
65 | //
66 | }
67 |
68 | /**
69 | * Show the form for editing the specified resource.
70 | *
71 | * @param int $id
72 | * @return \Illuminate\Http\Response
73 | */
74 | public function edit(Category $category)
75 | {
76 | return view('categories.create')->with('category', $category);
77 | }
78 |
79 | /**
80 | * Update the specified resource in storage.
81 | *
82 | * @param \Illuminate\Http\Request $request
83 | * @param int $id
84 | * @return \Illuminate\Http\Response
85 | */
86 | public function update(UpdateCategoriesRequest $request, category $category)
87 | {
88 | // $category->name = $request->name;
89 | $category->update([
90 |
91 | 'name'=> $request->name
92 | ]);
93 |
94 |
95 | session()->flash('success', 'Category updated successfully');
96 |
97 | return redirect(route('categories.index'));
98 | }
99 |
100 | /**
101 | * Remove the specified resource from storage.
102 | *
103 | * @param int $id
104 | * @return \Illuminate\Http\Response
105 | */
106 | public function destroy(Category $category)
107 | {
108 | if ($category->posts->count()>0) {
109 |
110 | session()->flash('error', 'Category cannot be deleted because it has some posts');
111 |
112 | return redirect()->back();
113 | }
114 |
115 | $category->delete();
116 |
117 | session()->flash('success', 'Category deleted successfully');
118 |
119 | return redirect(route('categories.index'));
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
17 | }
18 |
19 | /**
20 | * Show the application dashboard.
21 | *
22 | * @return \Illuminate\Contracts\Support\Renderable
23 | */
24 | public function index()
25 | {
26 | return view('home');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/PostsController.php:
--------------------------------------------------------------------------------
1 | middleware('verifyCategoriesCount')->only(['create', 'store']);
32 | $this->middleware('verifyCategoriesCount')->only(['create', 'store']);
33 | }
34 |
35 | /**
36 | * Display a listing of the resource.
37 | *
38 | * @return \Illuminate\Http\Response
39 | */
40 | public function index()
41 | {
42 | return view('posts.index')->with('posts', Post::all());
43 | }
44 |
45 | /**
46 | * Show the form for creating a new resource.
47 | *
48 | * @return \Illuminate\Http\Response
49 | */
50 | public function create()
51 | {
52 | return view('posts.create')->with('categories', Category::all())->with('tags', Tag::all());
53 | }
54 |
55 | /**
56 | * Store a newly created resource in storage.
57 | *
58 | * @param \Illuminate\Http\Request $request
59 | * @return \Illuminate\Http\Response
60 | */
61 | public function store(CreatePostsRequest $request)
62 | {
63 | // dd($request->all());
64 | // dd($request->image->store('posts'));
65 | //upload the image to storage
66 | $image = $request->image->store('posts');
67 |
68 | //create the post
69 | $post = Post::create([
70 |
71 | 'title' => $request->title,
72 |
73 | 'description' => $request->description,
74 |
75 | 'content' => $request->content,
76 |
77 | 'image' => $image,
78 |
79 | 'published_at' => $request->published_at,
80 |
81 | 'category_id' => $request->category,
82 |
83 | 'user_id' => auth()->user()->id
84 | ]);
85 |
86 | if ($request->tags) {
87 |
88 | $post->tags()->attach($request->tags);
89 | }
90 |
91 |
92 | //flash message
93 |
94 | session()->flash('success', 'Post created successfully.');
95 |
96 | //redirect user
97 | return redirect(route('posts.index'));
98 |
99 | }
100 |
101 | /**
102 | * Display the specified resource.
103 | *
104 | * @param int $id
105 | * @return \Illuminate\Http\Response
106 | */
107 | public function show($id)
108 | {
109 | //
110 | }
111 |
112 | /**
113 | * Show the form for editing the specified resource.
114 | *
115 | * @param int $id
116 | * @return \Illuminate\Http\Response
117 | */
118 | public function edit(Post $post)
119 | {
120 | // dd($post->tags->pluck('id')->toArray());
121 | return view('posts.create')->with('post', $post)->with('categories', Category::all())->with('tags', Tag::all());
122 | }
123 |
124 | /**
125 | * Update the specified resource in storage.
126 | *
127 | * @param \Illuminate\Http\Request $request
128 | * @param int $id
129 | * @return \Illuminate\Http\Response
130 | */
131 | public function update(UpdatePostRequest $request, Post $post)
132 | {
133 | $data = $request->only(['title', 'description', 'published_at', 'content']);
134 | //check new image
135 | if($request->hasFile('image')){
136 |
137 | //Upload it
138 | $image = $request->image->store('posts');
139 |
140 | //delete old image
141 | $post->deleteImage();
142 |
143 | $data['image'] = $image;
144 |
145 | }
146 |
147 | if ($request->tags) {
148 |
149 | $post->tags()->sync($request->tags);
150 | }
151 |
152 | //update attributes
153 | $post->update($data);
154 |
155 | //flash message
156 | session()->flash('success', 'Post updated successfully');
157 |
158 | //redirect user
159 | return redirect(route('posts.index'));
160 | }
161 |
162 | /**
163 | * Remove the specified resource from storage.
164 | *
165 | * @param int $id
166 | * @return \Illuminate\Http\Response
167 | */
168 | public function destroy($id)
169 | {
170 | $post = post::withTrashed()->where('id', $id)->firstOrFail();
171 |
172 | if ($post->trashed()){
173 |
174 | $post->deleteImage();
175 |
176 | $post->forceDelete();
177 |
178 | } else {
179 |
180 | $post->delete();
181 | }
182 |
183 | session()->flash('success', 'Post deleted successfully.');
184 |
185 | //redirect user
186 | return redirect(route('posts.index'));
187 | }
188 |
189 | /**
190 | * Display all trashed posts
191 | *
192 | * @param int $id
193 | * @return \Illuminate\Http\Response
194 | */
195 | public function trashed()
196 | {
197 | $trashed = Post::onlyTrashed()->get();
198 |
199 | return view('posts.index')->withPosts($trashed);
200 | }
201 |
202 | public function restore($id)
203 | {
204 | $post = post::withTrashed()->where('id', $id)->firstOrFail();
205 |
206 | $post->restore();
207 |
208 | session()->flash('success', 'Post restored successfuly');
209 |
210 | return redirect()->back();
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/TagsController.php:
--------------------------------------------------------------------------------
1 | with('tags', Tag::all());
23 | }
24 |
25 | /**
26 | * Show the form for creating a new resource.
27 | *
28 | * @return \Illuminate\Http\Response
29 | */
30 | public function create()
31 | {
32 | return view ('tags.create');
33 | }
34 |
35 | /**
36 | * Store a newly created resource in storage.
37 | *
38 | * @param \Illuminate\Http\Request $request
39 | * @return \Illuminate\Http\Response
40 | */
41 | public function store(CreateTagRequest $request)
42 | {
43 | // $this->validate($request, [
44 | // 'name'=> 'required|unique:Tags'
45 | // ]);
46 |
47 | Tag::create([
48 |
49 | 'name'=> $request->name
50 | ]);
51 |
52 | session()->flash('success', 'Tag created successfully.');
53 |
54 | return redirect(route('tags.index'));
55 | }
56 |
57 | /**
58 | * Display the specified resource.
59 | *
60 | * @param int $id
61 | * @return \Illuminate\Http\Response
62 | */
63 | public function show($id)
64 | {
65 | //
66 | }
67 |
68 | /**
69 | * Show the form for editing the specified resource.
70 | *
71 | * @param int $id
72 | * @return \Illuminate\Http\Response
73 | */
74 | public function edit(Tag $tag)
75 | {
76 | return view('tags.create')->with('tag', $tag);
77 | }
78 |
79 | /**
80 | * Update the specified resource in storage.
81 | *
82 | * @param \Illuminate\Http\Request $request
83 | * @param int $id
84 | * @return \Illuminate\Http\Response
85 | */
86 | public function update(UpdateTagsRequest $request, Tag $tag)
87 | {
88 | // $Tag->name = $request->name;
89 | $tag->update([
90 |
91 | 'name'=> $request->name
92 | ]);
93 |
94 |
95 | session()->flash('success', 'Tag updated successfully');
96 |
97 | return redirect(route('tags.index'));
98 | }
99 |
100 | /**
101 | * Remove the specified resource from storage.
102 | *
103 | * @param int $id
104 | * @return \Illuminate\Http\Response
105 | */
106 | public function destroy(Tag $tag)
107 | {
108 | if ($tag->posts->count()>0) {
109 |
110 | session()->flash('error', 'Tag cannot be deleted because it is associated with some posts');
111 |
112 | return redirect()->back();
113 | }
114 |
115 | $tag->delete();
116 |
117 | session()->flash('success', 'Tag deleted successfully');
118 |
119 | return redirect(route('tags.index'));
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/UsersController.php:
--------------------------------------------------------------------------------
1 | with('users', User::all());
16 | }
17 |
18 | public function edit()
19 | {
20 | return view('users.edit')->with('user', auth()->user());
21 | }
22 |
23 | public function update(UpdateProfileRequest $request)
24 | {
25 | $user = auth()->user();
26 |
27 | $user->update([
28 | 'name' => $request->name,
29 | 'about' => $request->about
30 | ]);
31 |
32 | session()->flash('success', 'User updated successfully');
33 |
34 | return redirect()->back();
35 | }
36 |
37 | public function makeAdmin(User $user)
38 | {
39 | $user->role = 'admin';
40 |
41 | $user->save();
42 |
43 | session()->flash('success', 'User made admin successfully');
44 |
45 | return redirect(route('users.index'));
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/cms/app/Http/Controllers/WelcomController.php:
--------------------------------------------------------------------------------
1 | query('search');
20 | // if ($search) {
21 | // $posts = Post::where('title', 'LIKE', "%{$search}%")->simplePaginate(2);
22 | // }else{
23 | // $posts = Post::simplePaginate(2);
24 | // }
25 |
26 |
27 |
28 |
29 | return view('welcome')
30 | ->with('categories', Category::all())
31 | ->with('tags', Tag::all())
32 | ->with('posts', Post::searched()->simplePaginate(2));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/cms/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
35 | \App\Http\Middleware\EncryptCookies::class,
36 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
37 | \Illuminate\Session\Middleware\StartSession::class,
38 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
39 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
40 | \App\Http\Middleware\VerifyCsrfToken::class,
41 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
42 | ],
43 |
44 | 'api' => [
45 | 'throttle:60,1',
46 | 'bindings',
47 | ],
48 | ];
49 |
50 | /**
51 | * The application's route middleware.
52 | *
53 | * These middleware may be assigned to groups or used individually.
54 | *
55 | * @var array
56 | */
57 | protected $routeMiddleware = [
58 | 'auth' => \App\Http\Middleware\Authenticate::class,
59 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
61 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
62 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
63 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
64 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
67 | 'verifyCategoriesCount' => VerifyCategoriesCount::class,
68 | 'admin' => verifyIsAdmin::class
69 | ];
70 |
71 | /**
72 | * The priority-sorted list of middleware.
73 | *
74 | * This forces non-global middleware to always be in the given order.
75 | *
76 | * @var array
77 | */
78 | protected $middlewarePriority = [
79 | \Illuminate\Session\Middleware\StartSession::class,
80 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
81 | \App\Http\Middleware\Authenticate::class,
82 | \Illuminate\Session\Middleware\AuthenticateSession::class,
83 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
84 | \Illuminate\Auth\Middleware\Authorize::class,
85 | ];
86 | }
87 |
--------------------------------------------------------------------------------
/cms/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/cms/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/cms/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | count() == 0) {
21 | session()->flash('error', 'You need to add categories to be able to create a post.');
22 | return redirect(route('categories.create'));
23 | // return redirect('/home');
24 | }
25 |
26 | return $next($request);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/cms/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | user()->isAdmin()) {
19 |
20 | return redirect( route('home'));
21 | }
22 |
23 | return $next($request);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/Categories/CreateCategoryRequest.php:
--------------------------------------------------------------------------------
1 | 'required|unique:categories'
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/Categories/UpdateCategoriesRequest.php:
--------------------------------------------------------------------------------
1 | 'required|unique:categories'
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/Tags/CreateTagRequest.php:
--------------------------------------------------------------------------------
1 | 'required|unique:tags'
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/Tags/UpdateTagsRequest.php:
--------------------------------------------------------------------------------
1 | 'required|unique:tags'
28 | ];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/Users/UpdateProfileRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
28 | 'about' => 'required'
29 | ];
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/posts/CreatePostsRequest.php:
--------------------------------------------------------------------------------
1 | 'required|unique:posts',
28 | 'decription' => 'nullable',
29 | 'image' => 'required|image',
30 | 'content' => 'required',
31 | 'category' => 'required'
32 | ];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/cms/app/Http/Requests/posts/UpdatePostRequest.php:
--------------------------------------------------------------------------------
1 | 'required',
28 |
29 | 'description' => 'required',
30 |
31 | 'content' => 'required',
32 |
33 | 'category' => 'required'
34 | ];
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/cms/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/cms/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/cms/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/cms/app/Tag.php:
--------------------------------------------------------------------------------
1 | belongsToMany(Post::class);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/cms/app/User.php:
--------------------------------------------------------------------------------
1 | 'datetime',
38 | ];
39 |
40 | public function isAdmin()
41 | {
42 | return $this->role == 'admin';
43 | }
44 |
45 | public function posts()
46 | {
47 | return $this->hasMany(Post::class);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/cms/app/category.php:
--------------------------------------------------------------------------------
1 | hasMany(Post::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/cms/app/post.php:
--------------------------------------------------------------------------------
1 | image);
31 | }
32 |
33 | public function category ()
34 | {
35 | return $this->belongsTo(Category::class);
36 | }
37 |
38 | public function tags()
39 | {
40 | return $this->belongsToMany(Tag::class);
41 | }
42 |
43 | /**
44 | * Check if a post has a tag
45 | *
46 | * @return bool
47 | */
48 | public function hasTag($tagId)
49 | {
50 | return in_array($tagId, $this->tags->pluck('id')->toArray());
51 | }
52 |
53 | public function user()
54 | {
55 | return $this->belongsTo(User::class);
56 | }
57 |
58 | public function scopePublished($query)
59 | {
60 | return $query->where('published_at', '<=', now());
61 | }
62 |
63 | public function scopeSearched($query)
64 | {
65 | $search = request()->query('search');
66 |
67 | if (!$search) {
68 | return $query->published();
69 | }
70 |
71 | return $query->published()->where('title', 'LIKE', "%{$search}%");
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/cms/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/cms/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/cms/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/cms/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": [
6 | "framework",
7 | "laravel"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^7.1.3",
12 | "fideloper/proxy": "^4.0",
13 | "laravel/framework": "5.8.*",
14 | "laravel/tinker": "^1.0",
15 | "thomaswelton/laravel-gravatar": "~1.0"
16 | },
17 | "require-dev": {
18 | "beyondcode/laravel-dump-server": "^1.0",
19 | "filp/whoops": "^2.0",
20 | "fzaninotto/faker": "^1.4",
21 | "mockery/mockery": "^1.0",
22 | "nunomaduro/collision": "^2.0",
23 | "phpunit/phpunit": "^7.5"
24 | },
25 | "config": {
26 | "optimize-autoloader": true,
27 | "preferred-install": "dist",
28 | "sort-packages": true
29 | },
30 | "extra": {
31 | "laravel": {
32 | "dont-discover": []
33 | }
34 | },
35 | "autoload": {
36 | "psr-4": {
37 | "App\\": "app/"
38 | },
39 | "classmap": [
40 | "database/seeds",
41 | "database/factories"
42 | ]
43 | },
44 | "autoload-dev": {
45 | "psr-4": {
46 | "Tests\\": "tests/"
47 | }
48 | },
49 | "minimum-stability": "dev",
50 | "prefer-stable": true,
51 | "scripts": {
52 | "post-autoload-dump": [
53 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
54 | "@php artisan package:discover --ansi"
55 | ],
56 | "post-root-package-install": [
57 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
58 | ],
59 | "post-create-project-cmd": [
60 | "@php artisan key:generate --ansi"
61 | ]
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/cms/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'token',
46 | 'provider' => 'users',
47 | 'hash' => false,
48 | ],
49 | ],
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | User Providers
54 | |--------------------------------------------------------------------------
55 | |
56 | | All authentication drivers have a user provider. This defines how the
57 | | users are actually retrieved out of your database or other storage
58 | | mechanisms used by this application to persist your user's data.
59 | |
60 | | If you have multiple user tables or models you may configure multiple
61 | | sources which represent each model / table. These sources may then
62 | | be assigned to any extra authentication guards you have defined.
63 | |
64 | | Supported: "database", "eloquent"
65 | |
66 | */
67 |
68 | 'providers' => [
69 | 'users' => [
70 | 'driver' => 'eloquent',
71 | 'model' => App\User::class,
72 | ],
73 |
74 | // 'users' => [
75 | // 'driver' => 'database',
76 | // 'table' => 'users',
77 | // ],
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Resetting Passwords
83 | |--------------------------------------------------------------------------
84 | |
85 | | You may specify multiple password reset configurations if you have more
86 | | than one user table or model in the application and you want to have
87 | | separate password reset settings based on the specific user types.
88 | |
89 | | The expire time is the number of minutes that the reset token should be
90 | | considered valid. This security feature keeps tokens short-lived so
91 | | they have less time to be guessed. You may change this as needed.
92 | |
93 | */
94 |
95 | 'passwords' => [
96 | 'users' => [
97 | 'provider' => 'users',
98 | 'table' => 'password_resets',
99 | 'expire' => 60,
100 | ],
101 | ],
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/cms/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/cms/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Cache Stores
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may define all of the cache "stores" for your application as
29 | | well as their drivers. You may even define multiple stores for the
30 | | same cache driver to group types of items stored in your caches.
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | ],
43 |
44 | 'database' => [
45 | 'driver' => 'database',
46 | 'table' => 'cache',
47 | 'connection' => null,
48 | ],
49 |
50 | 'file' => [
51 | 'driver' => 'file',
52 | 'path' => storage_path('framework/cache/data'),
53 | ],
54 |
55 | 'memcached' => [
56 | 'driver' => 'memcached',
57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
58 | 'sasl' => [
59 | env('MEMCACHED_USERNAME'),
60 | env('MEMCACHED_PASSWORD'),
61 | ],
62 | 'options' => [
63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
64 | ],
65 | 'servers' => [
66 | [
67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
68 | 'port' => env('MEMCACHED_PORT', 11211),
69 | 'weight' => 100,
70 | ],
71 | ],
72 | ],
73 |
74 | 'redis' => [
75 | 'driver' => 'redis',
76 | 'connection' => 'cache',
77 | ],
78 |
79 | 'dynamodb' => [
80 | 'driver' => 'dynamodb',
81 | 'key' => env('AWS_ACCESS_KEY_ID'),
82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
83 | 'region' => env('AWS_REGION', 'us-east-1'),
84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
85 | ],
86 |
87 | ],
88 |
89 | /*
90 | |--------------------------------------------------------------------------
91 | | Cache Key Prefix
92 | |--------------------------------------------------------------------------
93 | |
94 | | When utilizing a RAM based store such as APC or Memcached, there might
95 | | be other applications utilizing the same cache. So, we'll specify a
96 | | value to get prefixed to all our keys so we can avoid collisions.
97 | |
98 | */
99 |
100 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
101 |
102 | ];
103 |
--------------------------------------------------------------------------------
/cms/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Database Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here are each of the database connections setup for your application.
24 | | Of course, examples of configuring each database platform that is
25 | | supported by Laravel is shown below to make development simple.
26 | |
27 | |
28 | | All database work in Laravel is done through the PHP PDO facilities
29 | | so make sure you have the driver for your particular database of
30 | | choice installed on your machine before you begin development.
31 | |
32 | */
33 |
34 | 'connections' => [
35 |
36 | 'sqlite' => [
37 | 'driver' => 'sqlite',
38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
39 | 'prefix' => '',
40 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
41 | ],
42 |
43 | 'mysql' => [
44 | 'driver' => 'mysql',
45 | 'host' => env('DB_HOST', '127.0.0.1'),
46 | 'port' => env('DB_PORT', '3306'),
47 | 'database' => env('DB_DATABASE', 'forge'),
48 | 'username' => env('DB_USERNAME', 'forge'),
49 | 'password' => env('DB_PASSWORD', ''),
50 | 'unix_socket' => env('DB_SOCKET', ''),
51 | 'charset' => 'utf8mb4',
52 | 'collation' => 'utf8mb4_unicode_ci',
53 | 'prefix' => '',
54 | 'prefix_indexes' => true,
55 | 'strict' => true,
56 | 'engine' => null,
57 | 'options' => array_filter([
58 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
59 | ]),
60 | ],
61 |
62 | 'pgsql' => [
63 | 'driver' => 'pgsql',
64 | 'host' => env('DB_HOST', '127.0.0.1'),
65 | 'port' => env('DB_PORT', '5432'),
66 | 'database' => env('DB_DATABASE', 'forge'),
67 | 'username' => env('DB_USERNAME', 'forge'),
68 | 'password' => env('DB_PASSWORD', ''),
69 | 'charset' => 'utf8',
70 | 'prefix' => '',
71 | 'prefix_indexes' => true,
72 | 'schema' => 'public',
73 | 'sslmode' => 'prefer',
74 | ],
75 |
76 | 'sqlsrv' => [
77 | 'driver' => 'sqlsrv',
78 | 'host' => env('DB_HOST', 'localhost'),
79 | 'port' => env('DB_PORT', '1433'),
80 | 'database' => env('DB_DATABASE', 'forge'),
81 | 'username' => env('DB_USERNAME', 'forge'),
82 | 'password' => env('DB_PASSWORD', ''),
83 | 'charset' => 'utf8',
84 | 'prefix' => '',
85 | 'prefix_indexes' => true,
86 | ],
87 |
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Migration Repository Table
93 | |--------------------------------------------------------------------------
94 | |
95 | | This table keeps track of all the migrations that have already run for
96 | | your application. Using this information, we can determine which of
97 | | the migrations on disk haven't actually been run in the database.
98 | |
99 | */
100 |
101 | 'migrations' => 'migrations',
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Redis Databases
106 | |--------------------------------------------------------------------------
107 | |
108 | | Redis is an open source, fast, and advanced key-value store that also
109 | | provides a richer body of commands than a typical key-value system
110 | | such as APC or Memcached. Laravel makes it easy to dig right in.
111 | |
112 | */
113 |
114 | 'redis' => [
115 |
116 | 'client' => env('REDIS_CLIENT', 'predis'),
117 |
118 | 'options' => [
119 | 'cluster' => env('REDIS_CLUSTER', 'predis'),
120 | ],
121 |
122 | 'default' => [
123 | 'host' => env('REDIS_HOST', '127.0.0.1'),
124 | 'password' => env('REDIS_PASSWORD', null),
125 | 'port' => env('REDIS_PORT', 6379),
126 | 'database' => env('REDIS_DB', 0),
127 | ],
128 |
129 | 'cache' => [
130 | 'host' => env('REDIS_HOST', '127.0.0.1'),
131 | 'password' => env('REDIS_PASSWORD', null),
132 | 'port' => env('REDIS_PORT', 6379),
133 | 'database' => env('REDIS_CACHE_DB', 1),
134 | ],
135 |
136 | ],
137 |
138 | ];
139 |
--------------------------------------------------------------------------------
/cms/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/cms/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/cms/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Log Channels
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may configure the log channels for your application. Out of
27 | | the box, Laravel uses the Monolog PHP logging library. This gives
28 | | you a variety of powerful log handlers / formatters to utilize.
29 | |
30 | | Available Drivers: "single", "daily", "slack", "syslog",
31 | | "errorlog", "monolog",
32 | | "custom", "stack"
33 | |
34 | */
35 |
36 | 'channels' => [
37 | 'stack' => [
38 | 'driver' => 'stack',
39 | 'channels' => ['daily'],
40 | 'ignore_exceptions' => false,
41 | ],
42 |
43 | 'single' => [
44 | 'driver' => 'single',
45 | 'path' => storage_path('logs/laravel.log'),
46 | 'level' => 'debug',
47 | ],
48 |
49 | 'daily' => [
50 | 'driver' => 'daily',
51 | 'path' => storage_path('logs/laravel.log'),
52 | 'level' => 'debug',
53 | 'days' => 14,
54 | ],
55 |
56 | 'slack' => [
57 | 'driver' => 'slack',
58 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
59 | 'username' => 'Laravel Log',
60 | 'emoji' => ':boom:',
61 | 'level' => 'critical',
62 | ],
63 |
64 | 'papertrail' => [
65 | 'driver' => 'monolog',
66 | 'level' => 'debug',
67 | 'handler' => SyslogUdpHandler::class,
68 | 'handler_with' => [
69 | 'host' => env('PAPERTRAIL_URL'),
70 | 'port' => env('PAPERTRAIL_PORT'),
71 | ],
72 | ],
73 |
74 | 'stderr' => [
75 | 'driver' => 'monolog',
76 | 'handler' => StreamHandler::class,
77 | 'formatter' => env('LOG_STDERR_FORMATTER'),
78 | 'with' => [
79 | 'stream' => 'php://stderr',
80 | ],
81 | ],
82 |
83 | 'syslog' => [
84 | 'driver' => 'syslog',
85 | 'level' => 'debug',
86 | ],
87 |
88 | 'errorlog' => [
89 | 'driver' => 'errorlog',
90 | 'level' => 'debug',
91 | ],
92 | ],
93 |
94 | ];
95 |
--------------------------------------------------------------------------------
/cms/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => [
59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60 | 'name' => env('MAIL_FROM_NAME', 'Example'),
61 | ],
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | E-Mail Encryption Protocol
66 | |--------------------------------------------------------------------------
67 | |
68 | | Here you may specify the encryption protocol that should be used when
69 | | the application send e-mail messages. A sensible default using the
70 | | transport layer security protocol should provide great security.
71 | |
72 | */
73 |
74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | SMTP Server Username
79 | |--------------------------------------------------------------------------
80 | |
81 | | If your SMTP server requires a username for authentication, you should
82 | | set it here. This will get used to authenticate with your server on
83 | | connection. You may also set the "password" value below this one.
84 | |
85 | */
86 |
87 | 'username' => env('MAIL_USERNAME'),
88 |
89 | 'password' => env('MAIL_PASSWORD'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Sendmail System Path
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using the "sendmail" driver to send e-mails, we will need to know
97 | | the path to where Sendmail lives on this server. A default path has
98 | | been provided here, which will work well on most of your systems.
99 | |
100 | */
101 |
102 | 'sendmail' => '/usr/sbin/sendmail -bs',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Markdown Mail Settings
107 | |--------------------------------------------------------------------------
108 | |
109 | | If you are using Markdown based email rendering, you may configure your
110 | | theme and component paths here, allowing you to customize the design
111 | | of the emails. Or, you may simply stick with the Laravel defaults!
112 | |
113 | */
114 |
115 | 'markdown' => [
116 | 'theme' => 'default',
117 |
118 | 'paths' => [
119 | resource_path('views/vendor/mail'),
120 | ],
121 | ],
122 |
123 | /*
124 | |--------------------------------------------------------------------------
125 | | Log Channel
126 | |--------------------------------------------------------------------------
127 | |
128 | | If you are using the "log" driver, you may specify the logging channel
129 | | if you prefer to keep mail messages separate from other log entries
130 | | for simpler reading. Otherwise, the default channel will be used.
131 | |
132 | */
133 |
134 | 'log_channel' => env('MAIL_LOG_CHANNEL'),
135 |
136 | ];
137 |
--------------------------------------------------------------------------------
/cms/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | 'block_for' => 0,
50 | ],
51 |
52 | 'sqs' => [
53 | 'driver' => 'sqs',
54 | 'key' => env('AWS_ACCESS_KEY_ID'),
55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
58 | 'region' => env('AWS_REGION', 'us-east-1'),
59 | ],
60 |
61 | 'redis' => [
62 | 'driver' => 'redis',
63 | 'connection' => 'default',
64 | 'queue' => env('REDIS_QUEUE', 'default'),
65 | 'retry_after' => 90,
66 | 'block_for' => null,
67 | ],
68 |
69 | ],
70 |
71 | /*
72 | |--------------------------------------------------------------------------
73 | | Failed Queue Jobs
74 | |--------------------------------------------------------------------------
75 | |
76 | | These options configure the behavior of failed queue job logging so you
77 | | can control which database and table are used to store the jobs that
78 | | have failed. You may change them to any database / table you wish.
79 | |
80 | */
81 |
82 | 'failed' => [
83 | 'database' => env('DB_CONNECTION', 'mysql'),
84 | 'table' => 'failed_jobs',
85 | ],
86 |
87 | ];
88 |
--------------------------------------------------------------------------------
/cms/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_REGION', 'us-east-1'),
31 | ],
32 |
33 | 'sparkpost' => [
34 | 'secret' => env('SPARKPOST_SECRET'),
35 | ],
36 |
37 | 'stripe' => [
38 | 'model' => App\User::class,
39 | 'key' => env('STRIPE_KEY'),
40 | 'secret' => env('STRIPE_SECRET'),
41 | 'webhook' => [
42 | 'secret' => env('STRIPE_WEBHOOK_SECRET'),
43 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
44 | ],
45 | ],
46 |
47 | ];
48 |
--------------------------------------------------------------------------------
/cms/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/cms/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/cms/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(User::class, function (Faker $faker) {
19 | return [
20 | 'name' => $faker->name,
21 | 'email' => $faker->unique()->safeEmail,
22 | 'email_verified_at' => now(),
23 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
24 | 'remember_token' => Str::random(10),
25 | ];
26 | });
27 |
--------------------------------------------------------------------------------
/cms/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->enum('role',['writer','admin'])->default('writer');
21 | $table->text('about')->nullable();
22 | $table->timestamp('email_verified_at')->nullable();
23 | $table->string('password');
24 | $table->rememberToken();
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | *
32 | * @return void
33 | */
34 | public function down()
35 | {
36 | Schema::dropIfExists('users');
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/cms/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cms/database/migrations/2020_04_05_162508_create_categories_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('categories');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cms/database/migrations/2020_04_26_120252_create_tags_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->string('name');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('tags');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cms/database/migrations/2020_04_26_195800_create_post_tag_table.php:
--------------------------------------------------------------------------------
1 | bigIncrements('id');
18 | $table->integer('post_id');
19 | $table->integer('tag_id');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::dropIfExists('post_tag');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/cms/database/migrations/2020_04_27_162329_create_posts_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('title');
19 | $table->text('description');
20 | $table->text('content');
21 | $table->string('image');
22 | $table->integer('user_id');
23 | $table->integer('category_id');
24 | $table->timestamp('published_at')->nullable();
25 | $table->softDeletes();
26 | $table->timestamps();
27 | });
28 | }
29 |
30 | /**
31 | * Reverse the migrations.
32 | *
33 | * @return void
34 | */
35 | public function down()
36 | {
37 | Schema::dropIfExists('posts');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cms/database/migrations/2020_04_28_122643_add_soft_delete_to_posts_table.php:
--------------------------------------------------------------------------------
1 | softDeletes();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('posts', function (Blueprint $table) {
29 | $table->dropColumn('deleted_at');
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/cms/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 |
16 | $this->call(PostTableSeeder::class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/cms/database/seeds/PostTableSeeder.php:
--------------------------------------------------------------------------------
1 | 'News'
24 |
25 | ]);
26 |
27 | $author1 = App\User::create([
28 | 'name' => 'Ronny cyobe',
29 | 'email' => 'ronny@gmail.com',
30 | 'password' => Hash::make('password')
31 | ]);
32 |
33 | $author2 = App\User::create([
34 | 'name' => 'Ronaldinho cyobe',
35 | 'email' => 'ronaldinho@gmail.com',
36 | 'password' => Hash::make('password')
37 | ]);
38 |
39 | $category2 = Category::create([
40 | 'name' => 'Marketing'
41 |
42 | ]);
43 |
44 | $category3 = Category::create([
45 | 'name' => 'Partnership'
46 | ]);
47 |
48 | $post1 = Post::create([
49 | 'title' => 'We relocated our office to a new designed garage',
50 | 'description' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
51 | 'content' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
52 | 'category_id' => $category1 ->id,
53 | 'image' => 'posts/1.jpg',
54 | 'user_id' => $author1->id
55 | ]);
56 |
57 | $post2 = $author2->posts()->create([
58 | 'title' => 'Top 5 brilliant content marketing strategies',
59 | 'description' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
60 | 'content' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
61 | 'category_id' => $category2 ->id,
62 | 'image' => 'posts/2.jpg'
63 | ]);
64 |
65 | $post3 = $author1->posts()->create([
66 | 'title' => 'Best practices for minimalist design with example',
67 | 'description' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
68 | 'content' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
69 | 'category_id' => $category3 ->id,
70 | 'image' => 'posts/3.jpg'
71 | ]);
72 |
73 | $post4 = $author2->posts()->create([
74 | 'title' => 'Congratulate and thank to Maryam for joining our team',
75 | 'description' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
76 | 'content' => 'Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search fo',
77 | 'category_id' => $category2 ->id,
78 | 'image' => 'posts/4.jpg'
79 | ]);
80 |
81 | $tag1 = Tag::create([
82 | 'name' => 'job'
83 | ]);
84 |
85 | $tag2 = Tag::create([
86 | 'name' => 'customers'
87 | ]);
88 |
89 | $tag3 = Tag::create([
90 | 'name' => 'record'
91 | ]);
92 |
93 | $post1->tags()->attach([$tag1->id, $tag2->id]);
94 |
95 | $post2->tags()->attach([$tag2->id, $tag3->id]);
96 |
97 | $post3->tags()->attach([$tag1->id, $tag3->id]);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/cms/database/seeds/UsersTableSeeder.php:
--------------------------------------------------------------------------------
1 | first();
19 |
20 | if (!$user) {
21 |
22 | User::create([
23 | 'name' => 'Ronald Chobe',
24 |
25 | 'email' => 'chobe@gmail.com',
26 |
27 | 'role' => 'admin',
28 |
29 | 'password' => Hash::make('password')
30 | ]);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/cms/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.18",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "jquery": "^3.2",
17 | "laravel-mix": "^4.0.7",
18 | "lodash": "^4.17.5",
19 | "popper.js": "^1.12",
20 | "resolve-url-loader": "^2.3.1",
21 | "sass": "^1.15.2",
22 | "sass-loader": "^7.1.0",
23 | "vue": "^2.5.17"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/cms/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
Read and get updated on how we progress
24 | 25 |54 | 55 | {{ $post->category->name }} 56 | 57 |
58 |70 | No results found for query {{ request()->query('search') }} 71 |
72 | @endforelse 73 | 74 |Product
21 |By 28 | {{ $post->user->name }} 29 |
30 | 31 |Read and get updated on how we progress
24 | 25 |54 | 55 | {{ $post->category->name }} 56 | 57 |
58 |70 | No results found for query {{ request()->query('search') }} 71 |
72 | @endforelse 73 | 74 |Name | 26 | 27 |Posts count | 28 | 29 |30 | 31 | 32 | 33 | 34 | 35 | 36 | @foreach($categories as $category) 37 | 38 | |
---|---|---|
41 | 42 | {{ $category->name }} 43 | 44 | | 45 | 46 |47 | 48 | {{ $category->posts->count() }} 49 | 50 | | 51 | 52 |53 | 54 | Edit 55 | 56 | 57 | 58 | 59 | | 60 |
Image | 24 | 25 |Title | 26 | 27 |Category | 28 | 29 |30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @foreach($posts as $post) 38 | 39 | | ||
---|---|---|---|---|---|
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | |
56 |
57 | 58 | 59 | {{ $post->title }} 60 | 61 | | 62 | 63 |64 | 65 | 66 | {{ $post->category->name }} 67 | 68 | 69 | | 70 | 71 | @if(!$post->trashed()) 72 |73 | 74 | Edit 75 | 76 | | 77 | @else 78 |79 | 80 | 87 | 88 | | 89 | @endif 90 | 91 |92 | 93 | 105 | 106 | | 107 | 108 |
Name | 26 | 27 |Tags count | 28 | 29 |30 | 31 | 32 | 33 | 34 | 35 | 36 | @foreach($tags as $tag) 37 | 38 | |
---|---|---|
41 | 42 | {{ $tag->name }} 43 | 44 | | 45 | 46 |47 | 48 | {{ $tag->posts->count() }} 49 | 50 | | 51 | 52 |53 | 54 | Edit 55 | 56 | 57 | 58 | 59 | | 60 |
Image | 24 | 25 |Name | 26 | 27 |30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @foreach($users as $user) 38 | 39 | | |
---|---|---|---|
42 |
43 | |
46 |
47 | 48 | 49 | {{ $user->name }} 50 | 51 | | 52 | 53 | 54 |55 | 56 | {{ $user->email }} 57 | 58 | | 59 | 60 |61 | 62 | @if(!$user->isAdmin()) 63 | 64 | 70 | 71 | @endif 72 | 73 | | 74 | 75 |
Read and get updated on how we progress
24 | 25 |54 | 55 | {{ $post->category->name }} 56 | 57 |
58 |70 | No results found for query {{ request()->query('search') }} 71 |
72 | @endforelse 73 | 74 |