Laravel 8 tutorial - Post method API

  Рет қаралды 65,456

Code Step By Step

Code Step By Step

Күн бұрын

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

Пікірлер: 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!
@helium73
@helium73 3 ай бұрын
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?
@obulesukuraku1552
@obulesukuraku1552 4 жыл бұрын
Can you please explain model and show model view also
@mehtisadixov7871
@mehtisadixov7871 2 жыл бұрын
thank you so much bro
@fahadansari9431
@fahadansari9431 3 жыл бұрын
really helpful...
@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.
@vinoth3560
@vinoth3560 2 жыл бұрын
i use alpine how can i send the array object to controller as post method
@andistheinforitbutso7513
@andistheinforitbutso7513 6 ай бұрын
Pls make laravel 11 tutorial with Jetstream livewire using tailwind and alpinejs 😅
@codestepbystep
@codestepbystep 6 ай бұрын
Soon
@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
@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.
@high-techgalaxy5205
@high-techgalaxy5205 2 жыл бұрын
Hello Sir, How to posting data Without find the table or using model?
@eslamabdallahabass5662
@eslamabdallahabass5662 3 жыл бұрын
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.
@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.
@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 ?
@umidkurbanov5495
@umidkurbanov5495 3 жыл бұрын
I'm getting ereor 419. csrf missing. How to solve this pls?
@fahadmaqsood5636
@fahadmaqsood5636 3 жыл бұрын
@csrf
@mazharulalam3885
@mazharulalam3885 2 жыл бұрын
bro how to handle those errors?
@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
Code Step By Step
Рет қаралды 39 М.
Laravel 8 tutorial -  API authentication with Sanctum
15:51
Code Step By Step
Рет қаралды 81 М.
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 936 М.
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 8 МЛН
Laravel 8 tutorial - Update Data in Database
10:42
Code Step By Step
Рет қаралды 68 М.
Laravel 8 REST API With Sanctum Authentication
54:13
Traversy Media
Рет қаралды 548 М.
Laravel 8 tutorial -  API Validation
10:48
Code Step By Step
Рет қаралды 36 М.
Laravel 9 tutorial - Post method API
12:42
iFix Tech 4U
Рет қаралды 3,5 М.
Laravel 8 tutorial -  Delete method API
6:44
Code Step By Step
Рет қаралды 26 М.
30 Programming Truths I know at 30 that I Wish I Knew at 20
17:41
Laravel 8 tutorial -  Search API
5:58
Code Step By Step
Рет қаралды 38 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 223 М.
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 936 М.