How to use Laravel 8 Auth with Bootstrap/React, without Laravel UI? - php

Since Laravel UI started recommending Laravel Breeze and Jetstream packages then what is the best way to use Laravel Authentication with any frontend we need such as Bootstrap or React?
I don't need Livewire or Inertia at the moment but these are included in the above packages by default. Should I use Fortify or is there any other simple method to get the default Laravel Auth functionalities?

I would personally recommend using passport or sanctum.
Official documentation :
Before getting started, you may wish to determine if your application would be better served by Laravel Passport or Laravel Sanctum. If your application absolutely needs to support OAuth2, then you should use Laravel Passport.
However, if you are attempting to authenticate a single-page application, mobile application, or issue API tokens, you should use Laravel Sanctum. Laravel Sanctum does not support OAuth2; however, it provides a much simpler API authentication development experience.

Related

What is diffrence between Authentication and Middleware at Laravel?

Before i was using codeigniteur after the release of version 4CI i decided to learn laravel 7 now i am in learning stages of laravel 7 master version.
i am little confused and explored alot the documentation of laravel but i not found the solution might be my method of exploring or understanding documentation of laravel is not correct.
i have seen videos on YouTube that made me confused as some people use
php artisan make:auth
for creating user authentication but some people use
php artisan make:middleware
for creation user and some other uses unusall
$req->session()->put($user);
Now i understand that last method is just manual method for using user authentication but i not understand the diffrence between auth and middleware
Thank you in advance for your explanation
Middlewares allows you to add you to intercept your requests and add logic to them before they are pipelined to Controllers.
In laravel Authentication by default is done using Auth Midddleware.The logic to detect whether the user is logged in is done over here.
There is no limitation that you can only use middleware with relation to authentication only.

Is there any way to incorperate react with into an existing laravel 5.2 application?

I have an application built out in Laravel 5.2 with a mySQL DB, I'm trying to find a way to integrate React as the frontend framework with the version of Laravel I currently have. Is this possible?
Yes it is possible.
You can find more information in the official react docs:
https://reactjs.org/docs/add-react-to-a-website.html#add-react-in-one-minute
Definitively possible. You would be creating 2 apps: React for the front end and PHP/Laravel as an API for the data that your react app uses.

Laravel 5.2 create web service

I'm using Laravel 5.2 and I'd like to create a new web-service under laravel controlling environment.
is is applicable in laravel? or I need to build a normal web-service with php and connect it to my laravel app?
The target for building this web-service to work with Android and IOS Apps.
I searched at Laravel documentation but I found nothing related to web-service
You can use Lumen or laravel framework for develop web services
Lumen is a “micro-framework” built on top of Laravel’s components created by Taylor Otwell who is also responsible for Laravel.
It has been designed to develop micro services like small application
or web service. It has been developed for speed. In Lumen Symfony’s
Routing component which has been used by Laravel replaced by FastRoute
to enhance performance.
more details
https://coderexample.com/restful-api-in-lumen-a-laravel-micro-framework/

API-Centric app in Laravel 5.3

I want to make API (Laravel) and SPA (Vue.js) that uses this API. But I am not sure how to accomplish that.
2 separate projects (1 Laravel project for API and 1 Vue.js project for SPA)
or
1 Laravel project for both API (routes/api.php) and SPA (routes/web.php)
Which one to choose?
Separated projects are more clean and organized while all in one project is more practical.
What I do is create two different repositories ((project-api or project-server or project-backend) and (project-client or project-frontend)) if is a medium-large project and work on them completely separated. Both projects don't know nothing about each other.
Obs: The routing system on frontend is not managed by Laravel as appeared in what you wrote here and SPA (routes/web.php).
If you want to use separate projects, I suggest you use Vue-CLI for scaffolding Vue.js projects and Vue-Resource for web requests (XmlHttpRequest or JSONP)
Laravel also provides Laravel Elixir that support CSS and Javascript using Gulp and Webpack.
First, You must install node.js and npm, from there on I would suggest that you read the documentation to get you going further.

Laravel 5.1 and 5.3 which is best for beginner

I am new to laravel and but know core PHP well. And I am decided to create a project in laravel. So I started studying laravel. while I research about laravel, laravel community says that laravel 5.1 has Long term support(LTS). Now I confused which version want to use. Give me suggestions about which one want to use.
#Gowtham I reccommend to go for 5.3 version. because of realy specious features like
Laravel Scout: is a driver based full-text search for Eloquent
Laravel Mailable :is a new Mail class for sending emails in an expressive way.
Laravel Notifications : awesome feature which allows you to make quick updates through services like Slack, SMS, or Email.
Laravel Passport : Another superb feature . It is an optional package that is a full oAuth 2 server ready to go.
There are lot more which will curious you to go for 5.3 version.

Categories