Тёмный

Laravel 8 tutorial - Post method API 

Code Step By Step
Подписаться 319 тыс.
Просмотров 65 тыс.
50% 1

In this laravel 8 tutorial, we learn what is the post API and how to make the Post 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
API With Post Method
Why we use POST method
Setup postman for POST API
Code for Post API
Test API
Interview Question

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@khurrammughal5577
@khurrammughal5577 4 года назад
Bro i am From Pakistan and i have watched your all videos and it really helped me out. Great job and keep going.
@anuradhawithanage9861
@anuradhawithanage9861 3 года назад
Best Laravel tutorial ! Thanks a lot!
@ZubairKhan-rh5hj
@ZubairKhan-rh5hj 2 года назад
anuradha 1 ka double 😅
@Cat_ninj
@Cat_ninj Год назад
Very very well explained...it's very helpful for me .
@mohammadnaim9226
@mohammadnaim9226 Год назад
Nice explanation brother
@jairolima959
@jairolima959 6 месяцев назад
thanks for the explanation!
@obulesukuraku1552
@obulesukuraku1552 4 года назад
Can you please explain model and show model view also
@helium73
@helium73 2 месяца назад
Suppose you create an API. How do you protect it? If it's just a back end for your own app? I guess you could put your Vue front end in the public folder. But I'd rather not have my app code in that one folder while Laravel gets to stretch out all over the place. it doesn't seem fair. The front end is important especially if that's what your using to build your site. Do you have to use two domains though?
@fahadansari9431
@fahadansari9431 3 года назад
really helpful...
@mehtisadixov7871
@mehtisadixov7871 2 года назад
thank you so much bro
@kalyanipriyadarsini
@kalyanipriyadarsini 4 года назад
Nice tutorial
@shalinijaiswal7321
@shalinijaiswal7321 3 года назад
not working for me.. Getting this error "Illuminate\Contracts\Container\BindingResolutionException: Target class [app\Http\Controllers\TestController] does not exist. in file C:\Users\Acer\example-test\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 832"
@urvisharma2614
@urvisharma2614 3 года назад
Are you using using the route correctly. Theres different syntax for laravel 8 and laravel 7.
@namanmehta5243
@namanmehta5243 3 года назад
there are two ways you can try, I am not sure about which solution works in which Laravel version: 1) Route::namespace('App\Http\Controllers')->group(function () { Route::post("add", 'DeviceController@add'); }); 2) Route::post("add", [DeviceController::class, 'add']); Hope it helps someone before these solutions(versions) go obsolete.
@umangrajput1605
@umangrajput1605 3 года назад
I think u didnt import controller in uor api. Php route
@ignisync
@ignisync Год назад
use the form data instead of raw on postman
@fredoscott2346
@fredoscott2346 3 года назад
As stated in a previous video: SHOW US THE CODE FOR THE DAMN MODEL!!
@markgilbertarevalo6105
@markgilbertarevalo6105 3 года назад
It was! There is no code need if your table name is the plural form of your model. Ex: table name fruits, model name Fruit. The only code you need is public $timestamps = false; Because laravel will look for a table column name updated_at and created_at.
@andistheinforitbutso7513
@andistheinforitbutso7513 6 месяцев назад
Pls make laravel 11 tutorial with Jetstream livewire using tailwind and alpinejs 😅
@codestepbystep
@codestepbystep 6 месяцев назад
Soon
@eslamabdallahabass5662
@eslamabdallahabass5662 2 года назад
thank you
@shraizeAli
@shraizeAli Месяц назад
bro its not enough for understand the Api ,kindly make a small project to show data on frontend,submit form etc.
@professional-developer
@professional-developer 2 года назад
Hello Sir, How to posting data Without using Model in first test after create controller, if we have to use model then in this case database connect has been established
@aryansharma7995
@aryansharma7995 3 года назад
How can define data sending format that if I want to send data in form-data format only not in raw(json) format. please tell this same for other formats like x-www-form-urlencoded data
@vinoth3560
@vinoth3560 2 года назад
i use alpine how can i send the array object to controller as post method
@high-techgalaxy5205
@high-techgalaxy5205 2 года назад
Hello Sir, How to posting data Without find the table or using model?
@christiancarloroasa7837
@christiancarloroasa7837 2 года назад
i am just wonder I can do that on web to generate a list of data and convert it on Json decode to out put it on view. so what is the different of using it on web route rather on an api Route?
@abhishekbhagat9313
@abhishekbhagat9313 2 года назад
Api route helps to maintain the project routes and let us understand which are the api routes and web routes, will help us in future.
@shocchosolutions6275
@shocchosolutions6275 4 года назад
Bro what will happen if we used anything instead of name....
@dayahadiya9225
@dayahadiya9225 3 года назад
I want to post img then how to achieve ?
@joanvidal915
@joanvidal915 2 года назад
Hello brother sending post gives 500 Internal State Error, could you please help me? I have everything like you.
@joanvidal915
@joanvidal915 2 года назад
- this is post message: { "name":"supercomputer" "member_id":"4" } - this is devicecontroller add method: function add(Request $req){ $device = new Device; $device->name=$req->name; $device->member_id=$req->member_id; $result = $device->save(); if($result){ return ["Result" => "Data has been saved!"]; }else{ return["Result"=>"Operation failed!"]; } } - this is api route: Route::post("add",[DeviceController::class,'add']);
@joanvidal915
@joanvidal915 2 года назад
oh my bad, i forgot to add " , " in the request. Great tutorial btw you're a great teacher.
@mazharulalam3885
@mazharulalam3885 2 года назад
bro how to handle those errors?
@umidkurbanov5495
@umidkurbanov5495 3 года назад
I'm getting ereor 419. csrf missing. How to solve this pls?
@fahadmaqsood5636
@fahadmaqsood5636 3 года назад
@csrf
@abdulbasitsalah2918
@abdulbasitsalah2918 3 года назад
you miss the interview question
@thecodes
@thecodes 3 года назад
How to post list ????
@yassaryelurkar3631
@yassaryelurkar3631 3 года назад
I'm getting this error Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column
@agnisankarchakraborty1116
@agnisankarchakraborty1116 2 года назад
Same
@tester1471
@tester1471 2 года назад
you need to define body type as JSON(application/json) in postman
@mabdullah3644
@mabdullah3644 2 года назад
@@tester1471 Life Saver
@trungtran1635
@trungtran1635 2 года назад
@@tester1471 exactly
@ignisync
@ignisync Год назад
use the form data instead of raw on postman
@zangarkarabaev8583
@zangarkarabaev8583 2 года назад
Hello, where is csrf token?
@mihirpatel6758
@mihirpatel6758 2 года назад
Good question. May be CSRF token will be compulsary with Web/rote, not for api/route.someone please correct me if i am wrong.also give thumb's up if i am right
@krupalip8206
@krupalip8206 2 года назад
Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' (SQL: insert into `devices` (`name`, `member_id`, `updated_at`, `created_at`) values (?, ?, 2022-09-30 06:13:12, 2022-09-30 06:13:12)) in file C:\Users\sai\laravel-sanctum-api\vendor\laravel\framework\src\Illuminate\Database\Connection.php on line 759
@ignisync
@ignisync Год назад
use the form data instead of raw on postman
@abdellahlaraki6708
@abdellahlaraki6708 Год назад
@@ignisync brother you just save my life thank you
@aakritikishore1349
@aakritikishore1349 3 года назад
I am getting error 500
@mikhailrudoy8068
@mikhailrudoy8068 3 года назад
I got the same, but I added Content-Type: application/json in Fieddler->Parsed. After that it works for me
@flaviouscorreia536
@flaviouscorreia536 2 года назад
Start your development server in terminal, as well as apache and mysql in xampp and then send request.
Далее
Laravel 8 tutorial -  Put method API
8:50
Просмотров 39 тыс.
Laravel 8 REST API With Sanctum Authentication
54:13
Просмотров 547 тыс.
Laravel CRUD in 50 minutes for Beginners  from Scratch
49:58
Laravel 8 tutorial -  API Validation
10:48
Просмотров 36 тыс.
Sending Email using Python in 5 statements
9:53
Просмотров 232 тыс.