Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Best way to modify RegistrationController

    Modules
    2
    4
    537
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      manatech last edited by

      Hi. I want to implement my own registration controller. What is the best way to do that without touching the core?
      I want also to change the login controller to work according to my needs but I can not find where it is.

      1 Reply Last reply Reply Quote 0
      • S
        shivam-webkul last edited by

        Hi, @manatech

        Basically Controller is work for a route, so if you are want any specific route should be called using your controller then create a route file in your package & used same name of route as it have in core & when this route hit, call your controllers method.

        Thanks

        1 Reply Last reply Reply Quote 0
        • M
          manatech last edited by manatech

          @shivam-webkul said in Best way to modify RegistrationController:

          if you are want any specific route should b

          Thank you but it doesn't work. Here is my route in my new package:

          Route::group(['middleware' => ['theme']], function () {
              Route::prefix('customer')->group(function () {
                  Route::get('register', 'MyPackage\MyProject\Http\Controller\MyProjectController@show')
                      ->defaults('_config', [
                          'view' => 'auth::customers.signup.index'])->name('customer.register.index');
                  });
              });
          

          I created the views to override the form in the appropriate location but it always shows the original form in the core when I navigate to the customer/register form. I want it to show my form instead of the original form.
          Also running the following commands didn't help:

          composer dump-autoload
          php artisan config:cache
          php artisan route:cache
          php artisan view:cache
          
          1 Reply Last reply Reply Quote 0
          • S
            shivam-webkul last edited by

            Hi, @manatech

            You don't need to change the route, make same registration form as like present in customer followed by same folder structure.

            And in the boot methods write the override code and publish the vendor.

                $this->publishes([
                            __DIR__ . '/../Resources/views/shop/customers/account/index' => resource_path('views/vendor/shop/customers/account/index'),
                        ]);
            

            and publish by

            php artisan vendor:publish.

            Thanks

            1 Reply Last reply Reply Quote 0
            • First post
              Last post