Skip to content

Conversation

@RGO230
Copy link

@RGO230 RGO230 commented Jul 6, 2025

#10

@RGO230 RGO230 self-assigned this Jul 6, 2025
@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Jul 10, 2025
Copy link

@AZabolotnikov AZabolotnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why PR name "refactor: test"?
Task about controller refactoring.
Please rename PR.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This refactor introduces form request validation and API resource classes to improve structure and validation handling for the ExpoController endpoints. The changes replace manual validation and JSON response creation with Laravel's built-in form request validation and API resources.

  • Adds form request classes (SubscribeRequest, UnsubscribeRequest) with validation rules
  • Introduces API resource classes to standardize response formatting
  • Updates ExpoController to use form requests and resources instead of manual validation

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/ExpoControllerTest.php Updates test mocks to use specific request classes instead of generic Request
src/Http/Resources/*.php Adds new API resource classes for subscribe, unsubscribe, validation errors, and base functionality
src/Http/Requests/*.php Adds form request classes with validation rules and custom error handling
src/Http/ExpoController.php Refactors controller methods to use form requests and API resources
composer.json Adds dependency on ronasit/laravel-helpers package

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RGO230 RGO230 changed the title refactor: tests controller refactor Sep 1, 2025
@coveralls
Copy link

coveralls commented Sep 15, 2025

Pull Request Test Coverage Report for Build 19215259525

Details

  • 22 of 22 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.2%) to 78.472%

Totals Coverage Status
Change from base Build 17207573500: 1.2%
Covered Lines: 113
Relevant Lines: 144

💛 - Coveralls

@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Sep 15, 2025
@RGO230 RGO230 assigned DenTray and AZabolotnikov and unassigned RGO230 and DenTray Oct 23, 2025
@RGO230 RGO230 assigned AZabolotnikov and unassigned RGO230 Nov 4, 2025
@DenTray DenTray requested a review from Copilot November 7, 2025 10:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

migrations/create_exponent_push_notification_interests_table.php.stub:26

  • The up() and down() methods are missing return type declarations. For consistency with modern Laravel conventions and the test migration at tests/database/migrations/2014_10_12_000000_create_users_table.php (lines 9 and 18), these methods should declare : void as their return type.
    public function up()
    {
        Schema::create(config('exponent-push-notifications.interests.database.table_name'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('key')->index();
            $table->string('value');

            $table->unique(['key','value']);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RGO230 RGO230 assigned AZabolotnikov and unassigned DenTray Nov 9, 2025
@@ -0,0 +1,24 @@
<?php
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +13 to +14
$table->string('email')->unique();
$table->timestamps();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we need extra fields in the users table for tests

Suggested change
$table->string('email')->unique();
$table->timestamps();

@DenTray DenTray assigned RGO230 and unassigned AZabolotnikov Nov 11, 2025
Comment on lines +12 to +20
protected $table = 'users';

use Notifiable;
use ModelTrait;
use HasFactory;

protected $fillable = [
'email',
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need it for the just abstract class?

@RGO230 RGO230 assigned DenTray and unassigned RGO230 Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants