We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42035
    • 90 Posts
    Hi
    I have 2 application one with Modx and second is in Laravel with common modx database.

    Now My client have requirement to login into Laravel application using modx username and password.

    How can i make this possible ?
      Arkalp.com
      • 3749
      • 24,544 Posts
      Does the Laravel app have an API to let you log users in code? If not, you might have to do it the other way around (see this series of articles) or put a cURL function in a MODX plugin attached to OnWebAuthentication (I think) that manually logs the user into the Laravel app.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 42035
        • 90 Posts
        Hi BobRay,
        Thanks for your reply but i think i need to explain more so you can give me some better solution.

        I have modx application and database with 100 users.

        Now i want to give some of my users a different application (buit with laravel) to login in to system and perform operation on different UI.

        I need to use same database so user will login in to new application with same username and passsword stored in modx database.

        Now can you let me know how could i make it feasible with any example.
          Arkalp.com
          • 3749
          • 24,544 Posts
          Sorry, I don't have more advice until you answer my question.

          Does the Laravel app have an API to let you log users in code?

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 42035
            • 90 Posts
            Quote from: BobRay at Jun 30, 2017, 01:49 AM


            Does the Laravel app have an API to let you log users in code?


            What does this mean ?
            I did not understand exactly what you need to know sorry for that.

            Laravel is PHP framework, it doesn't have any pre built api to log users in code.

            we need to make it from scratch.
              Arkalp.com
              • 3749
              • 24,544 Posts
              If you're building it from scratch, you may be able to use a MODX plugin attached to OnWebLogin (and/or OnManagerLogin), that checks the $loginContext variable. If the context is correct, you could call a Laravel procedure to log the user into the Laravel app.

              There are several ways to do it described here, but I don't know enough about Laravel to recommend one: https://laravel.com/docs/5.4/authentication



                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 47732
                • 3 Posts
                Quote from: vinodjoshi6219 at Jun 27, 2017, 01:31 AM
                Hi
                I have 2 application one with Modx and second is in Laravel with common modx database.

                Now My client have requirement to login into Laravel application using modx username and password.

                How can i make this possible ?


                https://github.com/mylgeorge/laravel-modx

                composer require mylgeorge/laravel-modx