The main advantage of using WordPress Pete for when integrating WordPress and Laravel is the clean way this is done through the file located at the route app/Http/Middleware/WPAuthMiddleware.php at the Laravel installation folder. This way you don’t have to modify the WordPress or Laravel core.
Keep in mind that both WordPress and Laravel will share the same database and the table wp_users is used for both login systems but the logging process will be done from WordPress for convenience.
Install WordPress Pete in your development or production environment. Alternatively, you can play with the live demo at http://22.214.171.124. For this tutorial we are going to use the live demo that has the WordPess Pete Premium license validated
1. Browse to the live demo and create an account.
2. For this tutorial we will use the example of the Genuinely Passionate site to explore the amazing possibilities when you get together the best of both worlds by integrating WordPress with Laravel. Please download the WordPress Pete site file here
You can convert any WordPress site to the WordPress Pete format, to know how to do it, check this tutorial.
3. Check that the WordPress importer plugin is installed if not installed, install it.
4. Click on Import WordPress option then choose a unique project name and URL, for this tutorial we are going to use Project Name: genuinelypassionate and URL: genuinelypassionate.petetesting.com then select the file you downloaded in step 2.
Note: It is important that you select your own domain if you are following this tutorial, something like project name: myproject and URL: myproject.petetesting.com will be ok.
5. Great! we already have the website installed in WordPress Pete. Now go to my account page a login with the following credentials:
Note: If you are following this tutorial for your case it would be something like this:
6. Go to Plugins in your WordPress admin panel to activate the “Laravel Integration plugin by WordPressPete”. A copy of this plugin is installed by default with the Passionate site. Then go to Settings -> Laravel Integration and tick the checkbox “Allow cookies to go across all subdomains” and click on “Update Options”. You can also download the plugin from your WordPress Pete installation by clicking on “Plugins” sidebar option.
7. Log out from WordPress and log back in so that the plugin can allow cookies to go across all subdomains
8. Go to WordPress Pete installation again http://126.96.36.199/ and check that the WordPress+Laravel plugin is installed, if not installed install it. After this click on the option WordPress+Laravel in sidebar menu and then click Create WordPress Laravel Instance
9. For this example we will create a New WordPress + Laravel integration that comes with some buil-in examples included so you can check how easy it is to extend your WordPress with Laravel
Let’s use the Laravel version 8*, Project Name: dashboard and URL: http://dashboard.genuinelypassionate.petetesting.com then click CREATE.
10. You should see this page, Click on the link built-in examples
List WordPress users
List WordPress posts
List Woocommerce products
List Woocommerce orders
Edit WordPress posts
For more check the part two of this tutorial: https://wordpresspete.com/2020/11/05/create-a-wordpress-laravel-integration-with-wordpress-pete-part-two/