Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2b7ac78
Merge branch 'master' of https://github.com/7span/laravel-boilerplate
dhrumin-7span Jul 22, 2025
011f553
Merge branch 'master' of https://github.com/7span/laravel-boilerplate
dhrumin-7span Aug 6, 2025
617784e
Refactor exception handling for NotFoundHttpException
mruganshi-7span Sep 3, 2025
ff8aa16
Removed ExceptionHelper class
mruganshi-7span Sep 4, 2025
573cbca
Merge pull request #62 from 7span/fix/custom-exception
harshil-7span Sep 8, 2025
434c800
Refactord filter handling in baseModel
mruganshi-7span Sep 8, 2025
666fe55
Merge branch 'master' of https://github.com/7span/laravel-boilerplate
mruganshi-7span Sep 9, 2025
79d682c
Updated README to include Git configuring hook
mruganshi-7span Sep 9, 2025
ab741ac
Implemented shouldQueue in mail & added missing iso field in county m…
mruganshi-7span Sep 15, 2025
17fcb39
Renamed VERIFY_EMAIL to EMAIL_VERIFICATION in UserOtpFor enum
mruganshi-7span Sep 15, 2025
d191296
Removed sucpicious code and packages
mruganshi-7span Sep 25, 2025
9e4b30b
Merge pull request #68 from 7span/fix/remove-suspicious-code
harshil-7span Sep 25, 2025
c326cb6
Merge branch 'master' of https://github.com/7span/laravel-boilerplate
dhrumin-7span Sep 30, 2025
84011eb
Merge pull request #66 from 7span/fix/misc-fixes
harshil-7span Oct 27, 2025
bad4cbc
Merge pull request #65 from 7span/fix/husky-pre-commit-issue
harshil-7span Oct 27, 2025
7f679cd
Merge pull request #64 from 7span/fix/base-model-qb-filter
harshil-7span Oct 27, 2025
15086f7
Merge branch 'master' of https://github.com/7span/laravel-boilerplate
dhrumin-7span Oct 27, 2025
333179c
Add ApiModel attribute to controllers and implement dynamic model ext…
sanjay-7span Oct 31, 2025
2b04545
Rename forgetPassword to forgotPassword for consistency and update re…
damini-7span Nov 3, 2025
984998a
Merge pull request #76 from 7span/fix/naming-convention
harshil-7span Nov 3, 2025
e6e52ee
add support for delete
sanjay-7span Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ $ npm install && npm run build
# 3. Copy .env and configure
$ cp .env.example .env

# 4. Generate app key
# 4. Configure Git hooks (Husky)
$ git config core.hooksPath .husky

# 5. Generate app key
$ php artisan key:generate

# 5. Run migrations and seeders
# 6. Run migrations and seeders
$ php artisan migrate --seed

# 6. Start the server
# 7. Start the server
$ php artisan serve
```

Expand Down
4 changes: 2 additions & 2 deletions app/Enums/UserOtpFor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
enum UserOtpFor: string
{
case FORGOT_PASSWORD = 'forgot_password';
case VERIFY_EMAIL = 'verify_email';
case EMAIL_VERIFICATION = 'email_verification';

public function label(): string
{
return match ($this) {
self::FORGOT_PASSWORD => 'Forgot Password',
self::VERIFY_EMAIL => 'Verify Email',
self::EMAIL_VERIFICATION => 'Email Verification',
};
}
}
10 changes: 5 additions & 5 deletions app/Http/Controllers/Api/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ public function login(LoginRequest $request)
}

#[OA\Post(
path: '/api/forget-password',
operationId: 'forgetPassword',
path: '/api/forgot-password',
operationId: 'forgotPassword',
tags: ['Auth'],
summary: 'Forget Password with otp',
summary: 'Forgot Password with otp',
description: "Initiates the process to reset the user's password by otp.",

)]
public function forgetPassword(ForgetPasswordRequest $request): JsonResponse
public function forgotPassword(ForgetPasswordRequest $request): JsonResponse
{
$data = $this->authService->forgetPassword($request->validated());
$data = $this->authService->forgotPassword($request->validated());

return $this->success($data, 200);
}
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Api/CountryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Http\Controllers\Controller;
use App\Http\Resources\Country\Collection as CountryCollection;
use App\Models\Country;
use App\OpenApi\Attributes\ApiModel;


class CountryController extends Controller
Expand All @@ -22,6 +23,7 @@ public function __construct()
$this->countryService = new CountryService;
}

#[ApiModel(Country::class)]
#[OA\Get(
path: '/api/countries',
tags: ['Country'],
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Controllers/Api/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use App\Services\LanguageService;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Models\Language;
use App\OpenApi\Attributes\ApiModel;

class LanguageController extends Controller
{
Expand All @@ -20,6 +22,7 @@ public function __construct()
$this->langService = new LanguageService;
}

#[ApiModel(Language::class)]
#[OA\Get(
path: '/api/languages',
operationId: 'getLanguages',
Expand All @@ -33,6 +36,7 @@ public function index(Request $request): JsonResponse
return $this->success($data, 200);
}

#[ApiModel(Language::class)]
#[OA\Get(
path: '/api/languages/{language_id}',
operationId: 'getLanguageId',
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Api/MasterSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Http\Resources\MasterSetting\Resource;
use App\Models\MasterSetting;
use App\Http\Resources\MasterSetting\Collection;
use App\OpenApi\Attributes\ApiModel;

class MasterSettingController extends Controller
{
Expand All @@ -22,6 +23,7 @@ public function __construct()
$this->masterSettingService = new MasterSettingService;
}

#[ApiModel(MasterSetting::class)]
#[OA\Get(
path: '/api/settings',
operationId: 'getMasterSettings',
Expand Down
29 changes: 29 additions & 0 deletions app/Http/Controllers/Api/MediaController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Http\Controllers\Api;

use App\Traits\ApiResponser;
use OpenApi\Attributes as OA;
use App\Services\MediaService;
use App\Http\Controllers\Controller;

class MediaController extends Controller
{
use ApiResponser;

public function __construct(private MediaService $mediaService) {}

#[OA\Delete(
path: '/api/v1/media/{mediaId}',
operationId: 'adminDeleteMedia',
tags: ['Media'],
summary: 'Mobile > Delete media file',
security: [['bearerAuth' => []]]
)]
public function destroy($id)
{
$data = $this->mediaService->destroy($id);

return $this->success($data);
}
}
3 changes: 3 additions & 0 deletions app/Http/Controllers/Api/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use App\Http\Requests\Notification\OneSignalData;
use App\Http\Requests\Notification\Request as NotificationRequest;
use App\Http\Resources\Notification\Collection as NotificationCollection;
use App\Models\Notification;
use App\OpenApi\Attributes\ApiModel;

class NotificationController extends Controller
{
Expand All @@ -21,6 +23,7 @@ public function __construct()
$this->notificationService = new NotificationService;
}

#[ApiModel(Notification::class)]
#[OA\Get(
path: '/api/notifications',
operationId: 'notificationList',
Expand Down
22 changes: 3 additions & 19 deletions app/Http/Controllers/Api/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use App\Http\Requests\User\UpdateProfile;
use App\Http\Resources\User\Resource as UserResource;
use App\Http\Requests\User\ChangePassword as UserChangePassword;
use App\Models\User;
use App\OpenApi\Attributes\ApiModel;

class UserController extends Controller
{
Expand All @@ -23,28 +25,11 @@ public function __construct()
$this->userService = new UserService;
}

#[ApiModel(User::class)]
#[OA\Get(
path: '/api/me',
tags: ['Auth'],
summary: 'Get logged-in user details',
// responses: [
// new OA\Response(
// response: 200,
// description: 'Success'
// ),
// ],
// parameters: [
// new OA\Parameter(
// name: 'X-Requested-With',
// in: 'header',
// required: true,
// description: 'Custom header for XMLHttpRequest',
// schema: new OA\Schema(
// type: 'string',
// default: 'XMLHttpRequest'
// )
// ),
// ],
security: [[
'bearerAuth' => [],
]]
Expand Down Expand Up @@ -88,7 +73,6 @@ public function stats(): JsonResponse
)
),
],

security: [[
'bearerAuth' => [],
]]
Expand Down
3 changes: 2 additions & 1 deletion app/Mail/ForgetPasswordOtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Illuminate\Mail\Mailables\Content;
use Illuminate\Queue\SerializesModels;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Contracts\Queue\ShouldQueue;

class ForgetPasswordOtp extends Mailable
class ForgetPasswordOtp extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;

Expand Down
17 changes: 9 additions & 8 deletions app/Models/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ class Country extends Model
{
use BaseModel, HasFactory;

public $queryable = [
'id',
];

public $defaultSort = 'name';

public $allowedSorts = ['id', 'name'];

protected $fillable = [
'name',
'iso',
'iso3',
'iso_code',
'calling_code',
Expand All @@ -28,12 +37,4 @@ protected function casts(): array
'deleted_at' => 'timestamp',
];
}

public $queryable = [
'id',
];

public $defaultSort = 'name';

public $allowedSorts = ['id', 'name'];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
class ApiDefaultModal
class ApiModel
{
public function __construct(public string $modelName)
public function __construct(public string $model)
{
// parent::__construct(response: 401, description: $description);
}
Expand Down
Loading