Skip to content

Commit

Permalink
refactor directory
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Mar 27, 2024
1 parent 23e4d94 commit d5f8894
Show file tree
Hide file tree
Showing 87 changed files with 230 additions and 221 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Console\Commands;
namespace App\App\Console\Commands;

use Codinglabs\Roles\Role;
use App\Domain\Iam\Models\User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace App\Console\Commands\Counters;
namespace App\App\Console\Commands\Counters;

use Carbon\Carbon;
use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use App\Http\Controllers\Traits\ScheduledHabits;
use App\App\Http\Controllers\Traits\ScheduledHabits;

class HabitStreak extends Command
{
use ScheduledHabits;

protected $signature = 'counters:habit-streak';
protected $description = 'Counts the habit streak by looking at the habits from yesterday and record if complete';

Expand All @@ -19,7 +20,7 @@ public function handle()
$users->map(function ($user) {
$scheduledHabits = $user->scheduledHabits()->where('scheduled_completion', Carbon::now()->subDay())->get();

foreach($scheduledHabits as $scheduledHabit) {
foreach ($scheduledHabits as $scheduledHabit) {
if ($scheduledHabit->completed == 1) {
$scheduledHabit->habit->increment('streak');
$scheduledHabit->habit->increment('completed');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Console\Commands\Counters;
namespace App\App\Console\Commands\Counters;

use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use App\Http\Controllers\Traits\ScheduledHabits;
use App\App\Http\Controllers\Traits\ScheduledHabits;

class Testing extends Command
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace App\Console\Commands\Counters;
namespace App\App\Console\Commands\Counters;

use Carbon\Carbon;
use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use App\Http\Controllers\Traits\ScheduledHabits;
use App\App\Http\Controllers\Traits\ScheduledHabits;

class UserStreak extends Command
{
use ScheduledHabits;

protected $signature = 'counters:user-streak';
protected $description = 'Look at all scheduled habits for yesterday, record whether all streaks were completed or not';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Console\Commands;
namespace App\App\Console\Commands;

use Codinglabs\Roles\Role;
use App\Domain\Iam\Models\User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Console\Commands\Notifications;
namespace App\App\Console\Commands\Notifications;

use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use App\Notifications\DailyReminderNotification;
use App\Domain\Habits\Notifications\DailyReminderNotification;

class SendDailyHabitReminder extends Command
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Console\Commands\Notifications;
namespace App\App\Console\Commands\Notifications;

use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use App\Notifications\HabitGoalReminderNotification;
use App\Domain\Habits\Notifications\HabitGoalReminderNotification;

class SendHabitGoalReminder extends Command
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace App\Console\Commands\ScheduledHabits;
namespace App\App\Console\Commands\ScheduledHabits;

use Carbon\Carbon;
use App\Http\CacheKeys;
use App\Support\CacheKeys;
use App\Domain\Iam\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use App\Domain\Frequency\Enums\Frequency;
use App\Http\Controllers\Traits\ScheduledHabits;
use App\Domain\HabitSchedule\Models\HabitSchedule;
use App\App\Http\Controllers\Traits\ScheduledHabits;

class ScheduleHabitsForMonth extends Command
{
Expand Down
10 changes: 5 additions & 5 deletions app/Console/Kernel.php → app/App/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace App\Console;
namespace App\App\Console;

use App\Console\Commands\Counters\Testing;
use Illuminate\Console\Scheduling\Schedule;
use App\App\Console\Commands\Counters\Testing;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
Expand All @@ -13,11 +13,11 @@ protected function schedule(Schedule $schedule): void
// test
$schedule->command(Testing::class)->everyFiveMinutes();
// scheduling habits
// $schedule->command(ScheduleHabitsForMonth::class)->monthly();
// $schedule->command(ScheduleHabitsForMonth::class)->monthly();

// counters
// $schedule->command(HabitStreak::class)->daily();
// $schedule->command(UserStreak::class)->daily();
// $schedule->command(HabitStreak::class)->daily();
// $schedule->command(UserStreak::class)->daily();

// Notifications
// $schedule->command(SendDailyHabitReminder::class)->dailyAt('08:00');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Exceptions;
namespace App\App\Exceptions;

use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Route;
use App\Providers\RouteServiceProvider;
use App\Http\Requests\Auth\LoginRequest;
use App\App\Http\Controllers\Controller;
use App\App\Providers\RouteServiceProvider;
use App\App\Http\Requests\Auth\LoginRequest;

class AuthenticatedSessionController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use App\Providers\RouteServiceProvider;
use App\App\Http\Controllers\Controller;
use App\App\Providers\RouteServiceProvider;
use Illuminate\Validation\ValidationException;

class ConfirmablePasswordController extends Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\Providers\RouteServiceProvider;
use App\App\Http\Controllers\Controller;
use App\App\Providers\RouteServiceProvider;

class EmailVerificationNotificationController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\Providers\RouteServiceProvider;
use App\App\Http\Controllers\Controller;
use App\App\Providers\RouteServiceProvider;

class EmailVerificationPromptController extends Controller
{
Expand All @@ -17,7 +17,7 @@ class EmailVerificationPromptController extends Controller
public function __invoke(Request $request): RedirectResponse|Response
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(RouteServiceProvider::HOME)
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
? redirect()->intended(RouteServiceProvider::HOME)
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Validation\Rules;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Http\RedirectResponse;
use App\App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Password;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Validation\ValidationException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Password;
use Illuminate\Validation\ValidationException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Http\Request;
use App\Domain\Iam\Models\User;
use Illuminate\Validation\Rules;
use App\Http\Controllers\Controller;
use App\Http\Events\RegisteredEvent;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Http\RedirectResponse;
use App\Providers\RouteServiceProvider;
use App\App\Http\Controllers\Controller;
use App\App\Http\Events\RegisteredEvent;
use App\App\Providers\RouteServiceProvider;

class RegisteredUserController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Http\RedirectResponse;
use App\App\Http\Controllers\Controller;
use Illuminate\Validation\Rules\Password;

class UpdatePasswordController extends Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\Auth;
namespace App\App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\Verified;
use Illuminate\Http\RedirectResponse;
use App\Providers\RouteServiceProvider;
use App\App\Http\Controllers\Controller;
use App\App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\EmailVerificationRequest;

class VerifyEmailController extends Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers;
namespace App\App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\HabitSchedule;
namespace App\App\Http\Controllers\HabitSchedule;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\App\Http\Controllers\Controller;
use App\Domain\HabitSchedule\Models\HabitSchedule;
use App\Http\Requests\HabitSchedule\CancelHabitScheduleRequest;
use App\App\Http\Requests\HabitSchedule\CancelHabitScheduleRequest;

class CancelHabitScheduleController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\HabitSchedule;
namespace App\App\Http\Controllers\HabitSchedule;

use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\App\Http\Controllers\Controller;
use App\Domain\HabitSchedule\Models\HabitSchedule;
use App\Http\Requests\HabitSchedule\CompleteHabitScheduleRequest;
use App\App\Http\Requests\HabitSchedule\CompleteHabitScheduleRequest;

class CompleteHabitScheduleController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\HabitSchedule;
namespace App\App\Http\Controllers\HabitSchedule;

use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Traits\ScheduledHabits;
use App\App\Http\Controllers\Controller;
use App\App\Http\Controllers\Traits\ScheduledHabits;

class GetScheduledHabitsForDayController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers\Habits;
namespace App\App\Http\Controllers\Habits;

use Carbon\Carbon;
use Inertia\Inertia;
use Inertia\Response;
use App\Http\Controllers\Controller;
use App\App\Http\Controllers\Controller;
use App\Domain\Frequency\Enums\Frequency;

class CreateHabitController extends Controller
Expand Down
Loading

0 comments on commit d5f8894

Please sign in to comment.