REST API versioning in Laravel - laravel

I wanted to make versioning like a domain. So inside app directory i want to move all folders into v1, v2, etc. So it will be App\v1, App\v2 namespaces. I need an advice, how to re-write bootstrap/app.php file, to instruct laravel to load only providers needed for the particular version. Where to put admin panel ? Thanks for answer.

Don't modify the bootstrap classes, instead go with this structure for API:
App
Http
Api
V1
-ApiController.php
Controllerphp
OtherWebController.php

Related

Laravel Debugbar with laravel api routes

I have a Laravel API.
The front end application is completely separate from Laravel.
All Laravel routes are located in routes/api.php
Is there any way to make the Laravel Debugbar work in this case?
https://github.com/barryvdh/laravel-debugbar
barryvdh/laravel-debugbar needs to be installed on your Laravel project (actually all debuggers need to be present within the project to audit every request) and get its files served to the frontend to work (edit repsonses with Middleware/InjectDebugbar.php).
I won't say that it is impossible to get its insights on a separate front, who knows if you are ready to fork the project and communicate with the debug bar APIs.
For a simpler alternatives you can use:
laravel/telescope docs repo
Clockwork browser extension website repo
spatie/laravel-ray(paid) website docs

Laravel View Component support on view namespace

By default you can add components to resources/views/components and use them using x- prefix with blade files. I registerd a view namespace which is located on different directory and i want the components directory in that namespace to be discovered as well.
Is there a way on laravel 7 to add additional directory to discover?
The instructions for Manually Registering Package Components in the official component documentation at https://laravel.com/docs/master/blade#components should give you the functionality you are after by registering your components manually in a service provider.
That said, it might be worth thinking carefully about why you want to deviate from the default folder.
I hope this helps!

Intergrate Laravel Library in Codeigniter Project

I have one library in laravel :-
https://github.com/mjaschen/collmex
I want to integrate it in my Codeigniter project, Can anyone help me in it?
since both use composer, you can simply require it.
but since you can't use service providers...you have to call them manually (i.e. you won't get access to alias in laravel) except that...you can do everything as in laravel project.

Integrate another dashboard with userFrosting

I am building a web project and using UserFrosting for the backend, it comes with SB admin as a dashboard, but I want to change it with another dashboard built with AngularJS or maybe static HTML, something like that :
https://github.com/tui2tone/flat-admin-bootstrap-templates
So is this possible ? and if yes, how to do that ?
Since you mentioned SB Admin, I guess you're using UserFrosting v0.3.x
Changing the dashboard only requires to edit the userfrosting/templates/themes/default/dashboard.twig file.
Using the new UserFrosting V4, it's simple as overwriting the template file in a custom Sprinkle. If you didn't start working on your project yet, you should really check out V4 (which use a new, AdminLTE based template).

include php files from other servers in Laravel

I am working in a E-Commerce Laravel project. In this project, I need to include/require/import files stored in a different server of the E-Commerce. How I can do that? What are the paths I have to include? And what are the files I have to modify?
You really do not want to do that. Even if there is a possibility to include php files from different machine, it's an awful idea. Do not do that.
If you need to get some data from another server, use RESTful API or something like this.

Resources