Thak you for this tutorial save my life hehehehehehehehhe
@AtifNaseem3 жыл бұрын
great
@M0stwan1eD5 жыл бұрын
In Laravel 6.x install "laravel/ui" via composer and run "php artisan ui:auth" instead of make:auth
@AtifNaseem5 жыл бұрын
you are right in Laravel 6 php artisan ui:auth works
@saddamsagar20234 жыл бұрын
why we need make:auth though we just need to create a middleware and register it to kernel to perform.
@AtifNaseem4 жыл бұрын
You are right. Actually I was planning to initiate something else but I postponed.
@sumanprajapati12834 жыл бұрын
awesome simple way to explain ...thanks
@AtifNaseem4 жыл бұрын
Glad you liked it
@RindiBudiaramdhan0404904 жыл бұрын
can we use multi authentication? 1. for our website (already use JWTToken) 2. For another website who want sync data from my website (???) help ty
@AtifNaseem4 жыл бұрын
Yes you can.
@seanrald05135 жыл бұрын
I followed the tutorial but when i test to postman i get App key not found?? Please Help
@AtifNaseem5 жыл бұрын
Please check the AuthKey.php $token = request()->header('App-Key'); use Camel Case with the dash instead of the underscore.
@cseshahriar5 жыл бұрын
@@AtifNaseem I felt the same problem and solve it, Thanks
@makavelli6464 жыл бұрын
for ppl how still get this error Please check the AuthKey.php change $token = $request->header('App-Key'); to $token = $request->get('App-Key');
@andidarusman84084 жыл бұрын
thanks a lot
@nickcourage70594 жыл бұрын
For some reason, including an underscore in the value for ""APP_KEY" stopped this from working. Tried it with "TESTKEY vs TEST_KEY" and it had the same effect.
@AtifNaseem4 жыл бұрын
oooh!
@anicebitofbreadtomopupthel71443 жыл бұрын
Same problem for me, thank you for this.
@anicebitofbreadtomopupthel71443 жыл бұрын
For some reason it returns null, was wracking my brain on this for a good hour.
@mohanpatidar8883 жыл бұрын
I gave without header function ($request->APP_KEY)it's working and with header function is not working ?
@AtifNaseem3 жыл бұрын
and any other changes?
@visual1996b4 жыл бұрын
Hi, Thank You Very Much . I want to ask you why in postman works perfectly and in curl not?
@AtifNaseem4 жыл бұрын
My pleasure. No problem, share curl errors. I use curl.
@visual1996b4 жыл бұрын
@@AtifNaseem When I write the URL in the postam the JSON result is showing, but when I use the same URL in chrome or curl it gives the error "App key not found "
@AtifNaseem4 жыл бұрын
in curl you can use other parameters using post. but in url you can't. If you share your CURL code with me. I will modify it according to error.
@yohanysturiz52575 жыл бұрын
Que bien Muchas gracias!!, no entiendo mucho el ingles pero explicas muy bien!
@AtifNaseem5 жыл бұрын
gratias tibi
@mitalgal74673 жыл бұрын
hie can you explain how to make update API in Lumen ?
@AtifNaseem3 жыл бұрын
here is great stuff auth0.com/blog/developing-restful-apis-with-lumen/
@amolacharya53424 жыл бұрын
How is the middleware running? I mean, is it enough to be registered in kernel. Doesn't it need to be referenced in the route or the controller?
@AtifNaseem4 жыл бұрын
depends on you. How you manage your app.
@StefanoPartipilo3 жыл бұрын
Nice video. but if I want to pass the key to get the bees through vue is how can I do? I don't know how to get the key to be read via vue 😅
@AtifNaseem3 жыл бұрын
just like you did in postman
@vannhangang90794 жыл бұрын
Thank for your video. But now in laravel 8, I can't go to 127.0.0.1:8000/dashboard, it show that "page not found". But in web.php, it have Route::get('/dashboard', function () { return view('dashboard'); })->middleware(['auth'])->name('dashboard'); Can you help me?
@AtifNaseem4 жыл бұрын
any other url working?
@Roots90s3 жыл бұрын
localhost is okay but when I host this api and access via postman return is "key not found" btw I'm using laravel 7
@AtifNaseem3 жыл бұрын
only error is key not found. Is everything else working?
@Roots90s3 жыл бұрын
@@AtifNaseem btw is working now thanks man.
@farhanfauzan83554 жыл бұрын
hey man, im using laravel 6.*, why i dont get the APP_KEY that i set on postman's headers using $request->header('APP_KEY') ?? it returns an empty array.
@AtifNaseem4 жыл бұрын
I will soon update this series on Laravel 7.+
@farhanfauzan83554 жыл бұрын
@@AtifNaseem yes please! Also, can you add tutorial about guzzle and curl ? That would be very nice..
@muhammadfikri99344 жыл бұрын
hello this is a good tutorial, I managed to run on localhost but when I host this api and access via postman the message app key not found? did I make a mistake while hosting? thank you
@AtifNaseem4 жыл бұрын
You are right. I have pinned good solutions. Please read first 2 comments below the video.
@AldiJavier3 жыл бұрын
auth key not found when hosting? whats a problem?
@AtifNaseem3 жыл бұрын
if is working properly on localhost then it should work on hosting.
@amitdev14854 жыл бұрын
iam using larave 5.6 but still i cant get $request->header('APP_KEY') in middleware on keeping APP_KEY at headers...
@AtifNaseem4 жыл бұрын
have you solved?
@amitdev14854 жыл бұрын
Yes just kept appkey it worked it seems _ is not working either app-key will work or simply appkey but not app_key
@M0stwan1eD5 жыл бұрын
Thanks =3 Great tutorial!
@AtifNaseem5 жыл бұрын
My pleasure
@kalyanipriyadarsini4 жыл бұрын
Nice tutorial.. How to store the APP_KEY IN. env file and then compare it to get access the api
@AtifNaseem4 жыл бұрын
you can do in env XYZ_APP_KEY=[your_key_value] and use env('XYZ_APP_KEY','')
@kalyanipriyadarsini4 жыл бұрын
Thanks for quick response
@parisanaderi16473 жыл бұрын
it is not working to me. always return "app_key not found". ???????
@AtifNaseem3 жыл бұрын
can't say without looking at code.
@parisanaderi16473 жыл бұрын
@@AtifNaseem The problem is not the code. I realized the problem is copying and pasting the address in postman. I have to type the address postman every time. thankyou
@afaq964 жыл бұрын
Hello brother great series really helping me out but can you please tell about the best practices for maintaining Access Token and what technique to use in web laravel?
@AtifNaseem4 жыл бұрын
for Laravel best practices rest api, please check this www.lelocode.com/posts/laravel-api-tutorial-:-best-practices-laravel-rest-api-structure.
@gelhalim4 жыл бұрын
i faced this errur in login route : Method App\Http\Controllers\Auth\LoginController::showLoginForm does not exist.
@AtifNaseem4 жыл бұрын
does not exist, check the LoginController
@gelhalim4 жыл бұрын
@@AtifNaseem solved, its a comment generated automatically by unknown
@emmanuelochubili3 жыл бұрын
How can I login into a system with a token generated by admin
@AtifNaseem3 жыл бұрын
token generated by admin and who is accessing?
@emmanuelochubili3 жыл бұрын
@@AtifNaseem i want a user to login to a system without username or password but only a token generated by admin and sent to the user. Thanks
@geoffroyulrichkouadio39825 жыл бұрын
help me : Target class [App\Http\APP\Http\Middleware\AuthKey] does not exist.
@AtifNaseem5 жыл бұрын
is it showing anything else?
@justbrian82864 жыл бұрын
sir, despite using App-Key in camel case, I'm still getting the app key not found error
@AtifNaseem4 жыл бұрын
have you tested on postman?
@Askbowe4 жыл бұрын
@@AtifNaseem same error do i add the middlware like so ?? Route::middleware('Auth:Key')->get ............
@Askbowe4 жыл бұрын
GOT THE ERROR change API_KEY to API-KEY seems like the underscore is and issue
@itsrafsanjani4 жыл бұрын
@@Askbowe You're right. Thanks for your help.
@sinatraforeign4 жыл бұрын
It's a good tutorial but why do we need country for? u should just stick at log-in tokens. Like server created random number and u have to input it in the Log-In. Just like authentication but without the user. only randomly generated password.
@AtifNaseem4 жыл бұрын
to create something different : )
@ДенисСопин-ж5п4 жыл бұрын
Thank you so much! =)
@AtifNaseem4 жыл бұрын
You're welcome!
@thedriverux5 жыл бұрын
I don't get what I'm doing wrong. I have my key/value in postman exactly the same, yet my logic in AuthKey is returning "App key not found". why is Laravel not seeing the headers that Postman is sending?
@AtifNaseem5 жыл бұрын
Is your middleware working? coz we have this condition in middleware.
@thedriverux5 жыл бұрын
@@AtifNaseem the problem is that no matter what I set the condition to, it always gives me the error. For what ever the reason, it is not seeing the app_key in the header
@thedriverux5 жыл бұрын
ok, I fixed it by changing the line in AuthKey.php to this: $token = request()->header('App-Key'); It didn't like the Full Caps and needed the Camel Case with the dash instead of the underscore.
@AtifNaseem5 жыл бұрын
@@thedriverux Great
@oskarmaslek5 жыл бұрын
@@thedriverux I had the same problem, thanks for your help!
@zayyanramadhan99525 жыл бұрын
Hii can you help me? I learn your video, why must with artisan serve request header can be to get the header APP_KEY. But if i launch direct with laravel public without artisan serve, the header APP_KEY not have value at postman. So what i do for launch direct laravel public and get request header?
@AtifNaseem5 жыл бұрын
Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. The serve comamnd just starts up the php server. You can use localhost or 127.0.0.1
@zayyanramadhan99525 жыл бұрын
@@AtifNaseem i mean if with artisan serve i get port 8000 to launch, and this can get header request APP_KEY. But if i setting my website for hosting, i launch rest api like you in posman, header just null.
@zayyanramadhan99525 жыл бұрын
And have json message app key not found
@AtifNaseem5 жыл бұрын
@@zayyanramadhan9952Normally we test apis on local machine and then host it. Null header never occured. What is your host? Share your url I will check.
@AtifNaseem5 жыл бұрын
@Sergei Thank you. I was not understanding the point. You are right.
@meaningfullife70755 жыл бұрын
You sent the request from postman, I want to send it from CURL but i don't know how to add APP_KEY with the curl header !
Hi can you please help me!! How we can used passport with 2 different models, is it possible in laravel. I try to create an api Using another model in same project, but it was given me errors. Pls help me, waiting for reply. Video on this issue really helpful for most audience.
@AtifNaseem4 жыл бұрын
share your errors
@KistlakRajapakshaSevenNet5 жыл бұрын
Thank You Very Much Bro !! :D But, one thing.. I successfully created a token in one of the applications in cloud hosting. But, another app that is in the same cloud hosting returns true for JWT instead of a token. How can I Fix this ??
@AtifNaseem5 жыл бұрын
Thank you Kistalak Rajapaksha. Its difficult to say anything without looking at code :(
@haramohanmahalik25704 жыл бұрын
Hello your video asome. but how to create multi auth in laravel passport, actually I am a php developer,and I am also use guard API but not working
@AtifNaseem4 жыл бұрын
Will upload soon
@badbadi_krishika Жыл бұрын
Thank youu!
@AtifNaseem Жыл бұрын
You're welcome!
@SorrowBee_23 жыл бұрын
why me can't make auth on laravel 8
@AtifNaseem3 жыл бұрын
Laravel 8 is slightly different, concept / code will remain same.
@mohdqayyoomkhan24463 жыл бұрын
Thanks, 😊
@AtifNaseem3 жыл бұрын
You're welcome 😊
@asifmurtaz76254 жыл бұрын
Salam Thanks for such an informative video. I was in search of solution to a schnario when I happened to came across this video. can you please inform if this information can resolve my issue? I have developed a web based hospital management system. Users log in and larvel authenticate using the default Auth scaffold. Now we want an android based app to function upon the existing logic. How the app user can be authenticated?
@AtifNaseem4 жыл бұрын
You can use your default auth and on successful login can save csrf token to your android app for post submissions.
@HiMu23244 жыл бұрын
You deleted the learning table with all countries data,how come you are fetching it afterwards? learning table does not exist anymore!!!!
@AtifNaseem4 жыл бұрын
1:57 when you run php artisan migrate it actually creates all the tables and data.
@HiMu23244 жыл бұрын
@@AtifNaseem so the tables now exist locally on the machine not in php my admin sql database?
@amitdev14854 жыл бұрын
i guess APPKEY will work instead of APP_KEY...
@AtifNaseem4 жыл бұрын
yes amit dev
@developer_nijat4 жыл бұрын
This method is not good. Because you can access api route via api/country? App_key=abcdf
@developer_nijat4 жыл бұрын
Maybe question how to find app key. From network headers
@AtifNaseem4 жыл бұрын
actually these types of apis are accessed using server side programming.
@swarnadeeppramanick4 жыл бұрын
Thanks a lot
@AtifNaseem4 жыл бұрын
Most welcome
@mahabub03065 жыл бұрын
Bhai, Laravel 6 auth with jwt and Postman....plzzzz
@AtifNaseem5 жыл бұрын
starting soon Laravel 6
@umayantharavindu37032 жыл бұрын
hi, i watched your video, it was really helpful. can Str::random created token pass from controller into middleware instead of ABCDEFGH.....
@AtifNaseem2 жыл бұрын
Thanks umayantha ravindu. Yes, you can
@hamzashan83495 жыл бұрын
sir how to store jwt token
@AtifNaseem5 жыл бұрын
for cache watch this kzbin.info/www/bejne/q3rEqquAo8hqitE
@louisaldorio72514 жыл бұрын
I cant make uath
@AtifNaseem4 жыл бұрын
execute these composer require laravel/ui php artisan ui vue --auth
@vantienvlog98705 жыл бұрын
video thật ý nghĩa
@AtifNaseem5 жыл бұрын
Cảm ơn bạn.
@MuhammadAdnan-gx6rd5 жыл бұрын
Bhai Ecommerce with Laravel please. ..... thanks ...
@AtifNaseem5 жыл бұрын
Sure. Now I am starting ecommerce series soon. Don't forget to like : )
@MuhammadAdnan-gx6rd5 жыл бұрын
@@AtifNaseem subd + like
@muhammedrasituyank993 жыл бұрын
aleyküm selam bro thanks
@AtifNaseem3 жыл бұрын
Walaikum Assalam. Welcome.
@dougtktube5 жыл бұрын
thx
@AtifNaseem5 жыл бұрын
My pleasure.
@mohammadalabd1895 жыл бұрын
Finally
@AtifNaseem5 жыл бұрын
Thank you.
@SalvadorRap4 жыл бұрын
Giving app key in headers is stupid method. Everyone can see that key