Does soft deletes works on lumen framework? Limitations of Lumen? - laravel

I just wanted to know soft deletes on laravel is also works with lumen framework?
what are the limitations of lumen framework compared to laravel?
we are going to start a project with micro-services concept and considering about lumen framework.

Yes, SoftDeletes are supported in Lumen.
The limitations are:
Configuration is different (not everything is out the box)
The routing is very basic
Missing useful artisan commands and helpers
some additional Laravel packages won't work
missing sub-domain routing, no optional parameters in routes
So basically you are using a stripped down version of Laravel and you are missing flexibility.

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

How to include complex Vue app inside Laravel

I have a Laravel project, which should contain different Vue apps.
Some of these apps are quite-complex (stand-alone app.js file with its own components).
How can Laravel manage different vue apps, each one with its own app.js file and components?
One approach to solve this problem is to write vue apps as SEPARATE projects (using only frontend technologies) which connect with laravel using RESTful API.
This is in fact simple micro-services architecture (which include the hard separation between frontend and backend code). If you decide to do it, you will face CORS problem (but don't worry - you will find many solutions on internet e.g. this) because the vue app will be on different domain/subdomain that your RESTful laravel API.
Laravel support create restful API controllers - cmd:
php artisan make:controller API/MovieController --api --model=Movie
routing routes/api.php:
Route::group(['prefix'=>'v1'], function() {
Route::apiResource('movies', 'API\MovieController');
...
});
It is good to use for api authentication Laravel Passport (oauth2)
You should also build your separate vue applications using some modern frontend technologies like webpack, nmp (here is some example but you will probably find better)... long story - but this is good direction :)

how to connect two projects Laravel 4.2 and laravel 5.5?

i have a laravel 4.2 project that i want to connect it to laravel 5.5 project
Q1) how to login in the first and and authenticated to the second to so i don't have to login to the second
Q2)how to connect them to the same DB
Q3)let's say i'm in page X in laravel 4.2 and i want to direct it to Y in laravel 5.5 where i should write the route in laravel 4.2 or in 5.5 ?
at the end both of the projects are going to be on the same server and have the same domain if that is going to be helpful
Q1) how to login in the first and and authenticated to the second to so i don't have to login to the second
if the 2 webapp are in the same domain, it should not be an issue
especially if they use the same database.
Q2)how to connect them to the same DB
just use the same credentials and save it on each env file.
Q3)let's say i'm in page X in laravel 4.2 and i want to direct it to Y in laravel 5.5 where i should write the route in laravel 4.2 or in 5.5 ?
you can use the function route instead use the manual routing like
to('somepage-on-theother-laravel') this is a tedious work. So i want
to ask if why are you using the 2 webapp in the same domain instead of
just using 1 webapp framework. Im thinking that this laravel 4.2 is
the existing one and you're create a new one and you want to use the
laravel 5.5 right?
This is easy to do, just put both applications on the same server and link them using the same credentials in the .ENV file, don't forget you will also need to create Models in both apps so that both apps can use the tables.
As for the routes, you would need to add the routes & functions that can be called in each individual app.
So if the user clicks the URL for /link-to-4.2 you should have a route in 4.2:
Route::get('/link-to-4.2', 'index#controller');
and then in your 5.5 you should have a route for any URLs that direct to anything there. i.e: /link-to-5.5
Route::get('/link-to-5.5', 'index#controller');
this all being said, what is the justification for using 2 apps? I think there could be a number of security issues that might cause headaches, this will also likely be a real nightmare to manage moving forward.
I would strongely suggest that you just upgrade the 4.2 app to be 5.5.

how to use laravel illuminate in a custom project

I have a static site with a lot of pages. Now I got a new requirement. Client need a Client Area, I am thinking to use laravel Database Eloquent, Session, Form/html, Session and want to use them as alias like use in laravel/lumen. The problem is that I want static pages same as it is with .html extension, is there any solution? I want some packages with aliases to speed up.
I spent a complete day on Configuring Input and Eloquent but I wasn't able to setup to other packages. But I don't know how to set aliases and service providers. Any idea?
Specific:
I need Laravel Some packages
Session,
FileSystem
Mail
Input
Database
Html/Form,
Validation
I don't need others packages and need aliases same as laravel used in (config/app)
yes you can use laravel components outside laravel project please read the article : http://www.richardbagshaw.co.uk/using-illuminate-components/

gradually migrate application from codeigniter to Laravel

I have a quite large application written in Codeigniter 1.7.
It needs some significant enhancements and I have been evaluating Laravel 4 as the PHP framework.
I am trying to find out if anyone has successfully extended an existing Codeigniter application using Laravel so that some screens are Laravel and some are Codeigniter.
I imagine that authentication (currently using Ion Auth) and Session management (using mysql backend) would be two major hurdles to overcome.
If this is an option then I will explore in more detail as the amount of legacy code needing transferring is considerable.
Thanks in advance.
I suppose in your Laravel routes file, create a route for every page you have written in CodeIgniter. Route everything to the URL that CodeIgniter is expecting and as you complete portions in Laravel, change the routes to point to the correct ones Laravel expects as you go.
Before you do anything though, I'd get everything you need for authentication finished in Laravel, turn authentication off in CodeIgniter, and just let Laravel handle that in the routes.

Resources