How to publish API and broadcast route files in Laravel 11
Posted by
Dharmendra Kumar, Senior Software Engineer & Co founder at MyhospitalNow
–
New projects will get a leaner skeleton as of Laravel 11. Some of the route files, which might be intimidating for inexperienced developers, have to be removed as part of the endeavour to make it happen.
That being said, as your application expands, you may need to build a RESTful API or, for an app that uses WebSockets, broadcast events into channels.
To publish the API routes file in Laravel 11 and up, use:
php artisan install:api
This command will create theĀ routes/api.phpĀ file, but also installĀ Laravel Sanctum, create some migrations, and add aĀ config/sanctum.phpĀ file.
And to publish the broadcasting channels routes file, use:
php artisan install:broadcasting
Dharmendra Kumar, Senior Software Engineer & Co founder at MyhospitalNow
Experienced software developer proficient in HTML, CSS, and Bootstrap for crafting elegant and responsive user interfaces.
Skilled in Laravel and PHP, with a focus on building robust and scalable web applications.
Proficient in JavaScript for both frontend and backend development, leveraging frameworks like React and Vue.js.
Experienced in designing and consuming RESTful APIs to enable seamless communication between client and server.
Expertise in integrating payment gateways such as PayPal, Stripe, and Paytm for secure online transactions.
Familiar with Flutter, enabling the creation of natively compiled applications for mobile, web, and desktop.
Proficient in Android Studio, the primary IDE for developing Android applications.
Knowledgeable in Linux and Docker for efficient server management and application deployment.
Experienced in using Redis as an in-memory data structure store, enhancing application performance.
Passionate about staying updated with the latest technologies and continuously learning to deliver high-quality solutions.