Skip to content

Commit

Permalink
Install laravel pint
Browse files Browse the repository at this point in the history
  • Loading branch information
John Karlo authored and John Karlo committed Nov 4, 2023
1 parent 9209e35 commit 5a30015
Show file tree
Hide file tree
Showing 42 changed files with 100 additions and 103 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/NewPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ function ($user) use ($request) {
return $status == Password::PASSWORD_RESET
? redirect()->route('login')->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
->withErrors(['email' => __($status)]);
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/PasswordResetLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function store(Request $request): RedirectResponse
return $status == Password::RESET_LINK_SENT
? back()->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
->withErrors(['email' => __($status)]);
}
}
1 change: 1 addition & 0 deletions app/Http/Livewire/AddComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class AddComment extends Component
{
public $idea;

public $comment;

protected $rules = [
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Livewire/CreateIdea.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class CreateIdea extends Component
{
public $title;

public $category = 1;

public $description;

protected $rules = [
Expand Down
1 change: 1 addition & 0 deletions app/Http/Livewire/EditComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class EditComment extends Component
{
public Comment $comment;

public $body;

protected $rules = [
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Livewire/EditIdea.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
class EditIdea extends Component
{
public $idea;

public $title;

public $category;

public $description;

protected $rules = [
Expand Down
1 change: 1 addition & 0 deletions app/Http/Livewire/IdeaComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class IdeaComment extends Component
{
public $comment;

public $ideaUserId;

protected $listeners = [
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Livewire/IdeaIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class IdeaIndex extends Component
{
public $idea;

public $votesCount;

public $hasVoted;

public function mount(Idea $idea, $votesCount)
Expand All @@ -29,7 +31,7 @@ public function vote()
if ($this->hasVoted) {
try {
$this->idea->removeVote(auth()->user());
} catch(VoteNotFoundException $e) {
} catch (VoteNotFoundException $e) {
// Do nothing
}
$this->votesCount--;
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Livewire/IdeaShow.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class IdeaShow extends Component
{
public $idea;

public $votesCount;

public $hasVoted;

protected $listeners = [
Expand Down Expand Up @@ -38,7 +40,7 @@ public function vote()
if ($this->hasVoted) {
try {
$this->idea->removeVote(auth()->user());
} catch(VoteNotFoundException $e) {
} catch (VoteNotFoundException $e) {
// Do nothing
}
$this->votesCount--;
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Livewire/IdeasIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ class IdeasIndex extends Component
use WithPagination;

public $status;

public $category;

public $filter;

public $search;

protected $queryString = [
Expand Down Expand Up @@ -94,7 +97,7 @@ public function render()
})
->addSelect(['voted_by_user' => Vote::select('id')
->where('user_id', auth()->id())
->whereColumn('idea_id', 'ideas.id')
->whereColumn('idea_id', 'ideas.id'),
])
->withCount('votes')
->withCount('comments')
Expand Down
1 change: 0 additions & 1 deletion app/Http/Livewire/MarkCommentAsNotSpam.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ public function render()
return view('livewire.mark-comment-as-not-spam');
}
}

2 changes: 2 additions & 0 deletions app/Http/Livewire/SetStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class SetStatus extends Component
{
public $idea;

public $status;

public $notifyAllVoters;

public function mount(Idea $idea)
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Livewire/StatusFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Http\Livewire;

use App\Models\Idea;
use App\Models\Status;
use Illuminate\Support\Facades\Route;
use Livewire\Component;

class StatusFilters extends Component
{
public $status;

public $statusCount;

public function mount()
Expand All @@ -29,8 +29,8 @@ public function setStatus($newStatus)

if ($this->getPreviousRouteName() === 'idea.show') {
return redirect()->route('idea.index', [
'status' => $this->status,
]);
'status' => $this->status,
]);
}
}

Expand Down
1 change: 1 addition & 0 deletions app/Models/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Comment extends Model
use HasFactory;

protected $guarded = [];

protected $perPage = 20;

public function user()
Expand Down
5 changes: 3 additions & 2 deletions app/Models/Idea.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Idea extends Model
use HasFactory, Sluggable;

protected $guarded = [];

protected $perPage = 10;

public function comments()
Expand All @@ -24,8 +25,8 @@ public function sluggable(): array
{
return [
'slug' => [
'source' => 'title'
]
'source' => 'title',
],
];
}

Expand Down
12 changes: 6 additions & 6 deletions app/Models/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public function ideas()
public static function getCount()
{
return Idea::query()
->selectRaw("count(*) as all_statuses")
->selectRaw("count(case when status_id = 1 then 1 end) as open")
->selectRaw("count(case when status_id = 2 then 1 end) as considering")
->selectRaw("count(case when status_id = 3 then 1 end) as in_progress")
->selectRaw("count(case when status_id = 4 then 1 end) as implemented")
->selectRaw("count(case when status_id = 5 then 1 end) as closed")
->selectRaw('count(*) as all_statuses')
->selectRaw('count(case when status_id = 1 then 1 end) as open')
->selectRaw('count(case when status_id = 2 then 1 end) as considering')
->selectRaw('count(case when status_id = 3 then 1 end) as in_progress')
->selectRaw('count(case when status_id = 4 then 1 end) as implemented')
->selectRaw('count(case when status_id = 5 then 1 end) as closed')
->first()
->toArray();
}
Expand Down
1 change: 0 additions & 1 deletion app/Policies/CategoryPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\Category;
use App\Models\User;
use Illuminate\Auth\Access\Response;

class CategoryPolicy
{
Expand Down
1 change: 0 additions & 1 deletion app/Policies/CommentPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\Comment;
use App\Models\User;
use Illuminate\Auth\Access\Response;

class CommentPolicy
{
Expand Down
1 change: 0 additions & 1 deletion app/Policies/IdeaPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\Idea;
use App\Models\User;
use Illuminate\Auth\Access\Response;

class IdeaPolicy
{
Expand Down
1 change: 0 additions & 1 deletion app/Policies/StatusPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\Status;
use App\Models\User;
use Illuminate\Auth\Access\Response;

class StatusPolicy
{
Expand Down
1 change: 0 additions & 1 deletion app/Policies/VotePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Models\User;
use App\Models\Vote;
use Illuminate\Auth\Access\Response;

class VotePolicy
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"barryvdh/laravel-debugbar": "^3.8",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.21",
"laravel/pint": "^1.0",
"laravel/pint": "^1.13",
"laravel/sail": "^1.22",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion database/seeders/CategorySeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class CategorySeeder extends Seeder
Expand Down
1 change: 0 additions & 1 deletion database/seeders/CommentSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class CommentSeeder extends Seeder
Expand Down
1 change: 0 additions & 1 deletion database/seeders/IdeaSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class IdeaSeeder extends Seeder
Expand Down
1 change: 0 additions & 1 deletion database/seeders/StatusSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class StatusSeeder extends Seeder
Expand Down
1 change: 0 additions & 1 deletion database/seeders/VoteSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class VoteSeeder extends Seeder
Expand Down
Loading

0 comments on commit 5a30015

Please sign in to comment.