Laravel 8 tutorial - Post method API

  Рет қаралды 64,428

Code Step By Step

Code Step By Step

3 жыл бұрын

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

Пікірлер: 52
@khurrammughal5577
@khurrammughal5577 3 жыл бұрын
Bro i am From Pakistan and i have watched your all videos and it really helped me out. Great job and keep going.
@Cat_ninj
@Cat_ninj Жыл бұрын
Very very well explained...it's very helpful for me .
@anuradhawithanage9861
@anuradhawithanage9861 2 жыл бұрын
Best Laravel tutorial ! Thanks a lot!
@ZubairKhan-rh5hj
@ZubairKhan-rh5hj Жыл бұрын
anuradha 1 ka double 😅
@obulesukuraku1552
@obulesukuraku1552 3 жыл бұрын
Can you please explain model and show model view also
@mohammadnaim9226
@mohammadnaim9226 Жыл бұрын
Nice explanation brother
@fahadansari9431
@fahadansari9431 2 жыл бұрын
really helpful...
@kalyanipriyadarsini
@kalyanipriyadarsini 3 жыл бұрын
Nice tutorial
@jairolima959
@jairolima959 3 ай бұрын
thanks for the explanation!
@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
@mehtisadixov7871
@mehtisadixov7871 2 жыл бұрын
thank you so much bro
@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
@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.
@helium73
@helium73 Күн бұрын
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?
@eslamabdallahabass5662
@eslamabdallahabass5662 2 жыл бұрын
thank you
@andistheinforitbutso7513
@andistheinforitbutso7513 3 ай бұрын
Pls make laravel 11 tutorial with Jetstream livewire using tailwind and alpinejs 😅
@codestepbystep
@codestepbystep 3 ай бұрын
Soon
@high-techgalaxy5205
@high-techgalaxy5205 2 жыл бұрын
Hello Sir, How to posting data Without find the table or using model?
@vinoth3560
@vinoth3560 Жыл бұрын
i use alpine how can i send the array object to controller as post method
@shocchosolutions6275
@shocchosolutions6275 3 жыл бұрын
Bro what will happen if we used anything instead of name....
@dayahadiya9225
@dayahadiya9225 3 жыл бұрын
I want to post img then how to achieve ?
@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 Жыл бұрын
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.
@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 2 жыл бұрын
I think u didnt import controller in uor api. Php route
@ignisync
@ignisync Жыл бұрын
use the form data instead of raw on postman
@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 2 жыл бұрын
@csrf
@abdulbasitsalah2918
@abdulbasitsalah2918 3 жыл бұрын
you miss the interview question
@thecodes
@thecodes 2 жыл бұрын
How to post list ????
@joanvidal915
@joanvidal915 Жыл бұрын
Hello brother sending post gives 500 Internal State Error, could you please help me? I have everything like you.
@joanvidal915
@joanvidal915 Жыл бұрын
- 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 Жыл бұрын
oh my bad, i forgot to add " , " in the request. Great tutorial btw you're a great teacher.
@krupalip8206
@krupalip8206 Жыл бұрын
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
@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 Жыл бұрын
@@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
@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
Code Step By Step
Рет қаралды 39 М.
Laravel 8 tutorial - Http Request Methods
14:43
Code Step By Step
Рет қаралды 40 М.
Каха и суп
00:39
К-Media
Рет қаралды 5 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 156 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 21 МЛН
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 22 МЛН
Laravel 8 tutorial - Save Data in Database
12:22
Code Step By Step
Рет қаралды 95 М.
Laravel CRUD in 50 minutes for Beginners  from Scratch
49:58
Devtamin
Рет қаралды 190 М.
Laravel 8 tutorial -  API Validation
10:48
Code Step By Step
Рет қаралды 35 М.
From Blank to Blog With Laravel in 10 Minutes
12:21
Laracasts
Рет қаралды 11 М.
Top 25 API Testing Interview Questions & Answers | Rahul Shetty
48:13
Rahul Shetty Academy
Рет қаралды 488 М.
Laravel 8 tutorial -  API with Resource
7:14
Code Step By Step
Рет қаралды 31 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
Каха и суп
00:39
К-Media
Рет қаралды 5 МЛН