Laravel 8 tutorial - get data with API | get method

preview_player
Показать описание
In this laravel 8 tutorial, we learn what is the API and how to make the get API with a database in a simple way. This video is made by anil Sidhu in the English language.

laravel restfull api tutorial

steps of video
Make Controller
Make Route
Write a small code
Test API on Postman
Interview Question for API
Рекомендации по теме
Комментарии
Автор

$details = Detail::all();
$products = product::all();
return [$products, $details];

note: first you need to create two models after that in return you need also return it as array so postman will show as json format

abdifitahmashquul
Автор

Yes we get data from two three four or so on by just using relationship model 👍🏻 or join

omegacoding
Автор

I'm not sure whether correct or not but I got it this way.
public function apigetdata(){
$model1=apimodel::all();
$model2=apimodel2::all();
return $model1.$model2;
}

I created 2 models for 2 different tables and simply returned the whole data. correct me if I am wrong. Thanks

saikumarkandikonda
Автор

yes of course we can use twotable data in a single api. we just have to define it on the controller.

delacliqueentertainment
Автор

i think yes we can get from two table using one api
by using relationships

justifiedtransportapp
Автор

Thanks sir please continue with login and signup api with jwt

ranggg
Автор

There is no explanation how to create database

chanchan-pnqx
Автор

Please could you explain how you connect mysgl with laravel in details

عمرمحمد-عغغ
Автор

Yes we can get multiple table data and return as JSON response in API get request.

dev-bipu
Автор

i get error Class "app\Models\university" not found " this model i mention in controller but i get error spelling is also correct

nishantgholap
Автор

Hi Great video! by the way, you didn't show us the code in your Device model and how device model works.

waelhi
Автор

could not find the driver (SQL: select * from `XYZ`) it is coming error.

yashpanchal
Автор

can't fetch data using file_get_contents();

kishan_
join shbcf.ru