Skip to content

Commit 9e4375f

Browse files
odirleiborgertStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 0d5039f commit 9e4375f

File tree

8 files changed

+17
-32
lines changed

8 files changed

+17
-32
lines changed

app/Http/Controllers/Blog/BlogController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace App\Http\Controllers\Blog;
44

5+
use App\Models\Admin\Blog\Posts;
56
use App\Http\Controllers\Controller;
67
use App\Models\Admin\Blog\Categorys;
7-
use App\Models\Admin\Blog\Posts;
88
use Symfony\Component\HttpFoundation\Request;
99

1010
class BlogController extends Controller
@@ -13,7 +13,6 @@ class BlogController extends Controller
1313

1414
public function index(Request $request)
1515
{
16-
1716
$page = ($request->page ? $request->page : '');
1817
$posts = Posts::sortable(['publish_at' => 'desc'])->paginate(10);
1918

app/Http/Controllers/Blog/CategorieController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace App\Http\Controllers\Blog;
44

5+
use App\Models\Admin\Blog\Posts;
56
use App\Http\Controllers\Controller;
67
use App\Models\Admin\Blog\Categorys;
7-
use App\Models\Admin\Blog\Posts;
88
use Symfony\Component\HttpFoundation\Request;
99

1010
class CategorieController extends Controller
@@ -13,7 +13,6 @@ class CategorieController extends Controller
1313

1414
public function index(Request $request, $title, $id)
1515
{
16-
1716
$page = ($request->page ? $request->page : '');
1817
$category = Categorys::find($id);
1918
$posts = Posts::categoryId($id)->sortable(['publish_at' => 'desc'])->paginate(10);

app/Http/Controllers/Blog/CommentController.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,28 @@
22

33
namespace App\Http\Controllers\Blog;
44

5-
use App\Http\Controllers\Controller;
65
use App\Models\Admin\Blog\Comments;
6+
use App\Http\Controllers\Controller;
77
use Symfony\Component\HttpFoundation\Request;
88

99
class CommentController extends Controller
1010
{
11-
1211
// -------------------------------------------------------------------
1312

1413
public function index(Request $request, $title, $id)
1514
{
16-
1715
Comments::create([
1816
'post_id' => $id,
1917
'name' => $request->name,
2018
'email' => $request->email,
2119
'description' => $request->comment,
22-
'status' => 0
20+
'status' => 0,
2321
]);
2422

2523
\Session::flash('success', trans('blog/frontend.comments_success'));
2624

2725
return redirect()->route('blog.post', ['id' => $id, 'title' => $title]);
28-
2926
}
3027

3128
// -------------------------------------------------------------------
32-
3329
}

app/Http/Controllers/Blog/PostController.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,24 @@
22

33
namespace App\Http\Controllers\Blog;
44

5-
use App\Http\Controllers\Controller;
65
use App\Models\Admin\Blog\Posts;
7-
use App\Models\Admin\Blog\Comments;
6+
use App\Http\Controllers\Controller;
87
use Symfony\Component\HttpFoundation\Request;
98

109
class PostController extends Controller
1110
{
12-
1311
// -------------------------------------------------------------------
1412

1513
public function index(Request $request, $titulo, $id)
1614
{
17-
1815
$post = Posts::where(['status' => 1, 'id' => $id])->first();
1916

2017
if ($post) {
2118
return view('blog.post', compact('post'));
2219
}
2320

2421
return view('blog.empty');
25-
2622
}
2723

2824
// -------------------------------------------------------------------
29-
3025
}

app/Http/Controllers/Blog/SearchController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
namespace App\Http\Controllers\Blog;
44

5-
use App\Http\Controllers\Controller;
65
use App\Models\Admin\Blog\Posts;
7-
use App\Models\Admin\Blog\SearchTerms;
6+
use App\Http\Controllers\Controller;
87
use Symfony\Component\HttpFoundation\Request;
98

109
class SearchController extends Controller
@@ -13,7 +12,6 @@ class SearchController extends Controller
1312

1413
public function index(Request $request)
1514
{
16-
1715
$page = ($request->page ? $request->page : 1);
1816
$term = $request->input('term');
1917

app/Http/Controllers/Blog/SitemapController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22

33
namespace App\Http\Controllers\Blog;
44

5+
use App\Models\Admin\Blog\Posts;
56
use App\Http\Controllers\Controller;
67
use App\Models\Admin\Blog\Categorys;
7-
use App\Models\Admin\Blog\Posts;
88

99
class SitemapController extends Controller
1010
{
1111
// -------------------------------------------------------------------
1212

1313
public function index()
1414
{
15-
1615
$posts = Posts::sortable(['publish_at' => 'asc'])->get();
17-
$categorys = Categorys::where('status',1)->get();
16+
$categorys = Categorys::where('status', 1)->get();
1817

19-
return response()->view('blog.sitemap', compact('posts','categorys'))->header('Content-Type', 'text/xml');
18+
return response()->view('blog.sitemap', compact('posts', 'categorys'))->header('Content-Type', 'text/xml');
2019
}
2120

2221
// -------------------------------------------------------------------

app/Models/Admin/Blog/Categorys.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ class Categorys extends Model
3131
public function seo($type = null)
3232
{
3333
if ($type === null) {
34-
return null;
34+
return;
3535
}
3636

3737
if ($type === 'title') {
38-
if (!empty($this->seo_title)) {
38+
if (! empty($this->seo_title)) {
3939
return str_limit($this->seo_title, 70);
4040
}
4141

4242
return str_limit($this->title, 70);
4343
}
4444

4545
if ($type === 'description') {
46-
if (!empty($this->seo_description)) {
46+
if (! empty($this->seo_description)) {
4747
return str_limit($this->seo_description, 170);
4848
}
4949

@@ -56,5 +56,4 @@ public function seo($type = null)
5656
}
5757

5858
// ----------------------------------------------------------------------------
59-
6059
}

app/Models/Admin/Blog/Posts.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Posts extends Model
5353
'title' => 10,
5454
'summary' => 8,
5555
'description' => 6,
56-
]
56+
],
5757
];
5858

5959
// -------------------------------------------------------------------------------
@@ -74,7 +74,7 @@ public function comments()
7474

7575
public function image($thumb = false)
7676
{
77-
$img = collect(\Storage::disk('uploads')->files('blog/posts/'.$this->id.'/' . ($thumb?'thumbnail/':'')))->first();
77+
$img = collect(\Storage::disk('uploads')->files('blog/posts/'.$this->id.'/'.($thumb ? 'thumbnail/' : '')))->first();
7878

7979
return $img ? 'uploads/'.$img : null;
8080
}
@@ -91,19 +91,19 @@ public function scopeCategoryId($query, $category_id)
9191
public function seo($type = null)
9292
{
9393
if ($type === null) {
94-
return null;
94+
return;
9595
}
9696

9797
if ($type === 'title') {
98-
if (!empty($this->seo_title)) {
98+
if (! empty($this->seo_title)) {
9999
return str_limit($this->seo_title, 70);
100100
}
101101

102102
return str_limit($this->title, 70);
103103
}
104104

105105
if ($type === 'description') {
106-
if (!empty($this->seo_description)) {
106+
if (! empty($this->seo_description)) {
107107
return str_limit($this->seo_description, 170);
108108
}
109109

0 commit comments

Comments
 (0)