thank you so much for this. i was able to use the observer to update the comment count in the post table every time a new comment was added. i am really learning a lot from you... i hope you will continue doing this tutorial videos.. you are a gift to all of us.
@ridwanajibari44437 жыл бұрын
subscribed, i need to watch all of your series
@AbhimanyuNaikareWebDeveloper6 жыл бұрын
Would passport be a better alternative to videos 23?
@robbradley13375 жыл бұрын
Yes.
@Sinrise6 жыл бұрын
Using Laravel 5.7, this isn't working when creating a new user. The seeding part works but I get "no default value for api_token" error when saving a new user.
@Sinrise6 жыл бұрын
Once again I forgot about php artisan config:cache. After running that, it works.
@artyom_mezin5 жыл бұрын
@@Sinrise thx! your comment is a key to this problem )
@xanthos7337 жыл бұрын
Hey Alex, could you do a video or write down in the description which packages you are using for Atom?
@santoshwankhede59267 жыл бұрын
Sir I am a great fan of your teaching laravel and always wait for your next o ne video......Very few peoples are like you......Could you make a video on Jwt authentication for api in laravel..
@elyunterim7 жыл бұрын
how to make a modal dialog with buefy to delete an item from a data listing in a table? Are we going to learn this on the blog?
@mohamedmamdouh64537 жыл бұрын
Hi what if i have multilevel authentications like [ Users - Admins - Sellers ] etc , How could i manage the tokens and do you have a way to do that with JWY or Passport ? Thanks in Advance :)
@johnjosephflorina44506 жыл бұрын
Nice video i like all your video
@advaithaj3037 жыл бұрын
What is the difference between observers and events? We can fire an even when ever we are creating, deleteing, etc or created, deleted, etc by using the dispatchesEvents protected variable inside the model
@JacurtisTutorials7 жыл бұрын
Observers are "lower level". They won't be queued (like normally events would be) and they have DIRECT ACCESS to the model you are working with. Events are good for triggering things to happen like sending an email or a notification, but they arent good for directly manipulating the model, which is what we needed here. While you can trigger events at the "creating" state, the model doesn't wait around for the event and all of its listeners to complete. It simply triggers the event and keeps moving. The observer on the other hand is designed to directly manipulate the model. So it jumps in and runs its process and actually holds up the save() function while it works. So by targeting the "creating" stage, we know that the observer is going to be able to finish its job before the model continues the save process. So each has its own purpose. If i wanted to send a welcome email whenever a new user is added to the database, then creating an event tied to the "created" event would be the smarter way to do it. You wouldn't want to use observers for that task because 1) you want that process to be queued and observers can't be queued, and 2) you don't want the model to continue waiting on the observer to finish sending the email. So emails and notifications are great for events because they don't need direct access to the model (only a copy of it) and they can happen asynchronous of the event's save procedure. Observers are better for directly manipulating the model like we do in this video because we do want to hold up the save procedure until we generate that new api_token and we want it run synchronous to the save procedure. I have a video on using events to send a welcome email whenever a user is "created", if you want to see how you would do that: kzbin.info/www/bejne/j3m6ZoywoqZslac
@ridwanajibari44437 жыл бұрын
i love how you explain this. thanks.
@christostsangaris47856 жыл бұрын
@@JacurtisTutorials Always on point! Lucky to have you around Alex!
@easyvideott75057 жыл бұрын
This one was really great!
@jamesparsons85467 жыл бұрын
Where you are using axios through Laravel, I thought you didnt need api tokens as the request is validated through the auth middleware and session. Is there a reason why this wouldnt be secure?
@siliver016 жыл бұрын
How did you create that auth page?
@moneymakr6396 жыл бұрын
@DevMarketer - great video..unfortunatly all I get is unauthortized when I try to to to my API url.
@raymondmichael49877 жыл бұрын
Oooohps!! First to comment,API This will be much fun
@SimionChis6 жыл бұрын
For me, random is something like dice. Sometimes you have luck and you hit 6,6,6. If this happened in observer, i think the creating of user will stop and a error will be thrown. Am I right?
@voneatpen60607 жыл бұрын
Hi, I have php -m, there is openssl but still when seeding, it says Field 'api_token' doesn't have a defau lt value. what should I do?
@robertomunhoz33997 жыл бұрын
I have the same problem. But when i put $user->api_token = bin2hex(openssl_random_pseudo_bytes(30)); in store on controller, it´s work. I´m confused now!
@djebirihamza10986 жыл бұрын
thank's for your help but i have a problem when i try to access in a page protect by auth:api with my vuejs function ($http ) it return this error 401 (Unauthorized) i'd like to redirect it to login page if user is a guest thank's a lot
@odunladeoluwaseun78807 жыл бұрын
Thanks for awesome job u are doing sir. Please i asked a question on your previous laravel series but it has not been answered. (series 33). I love to add anchor tag on my categories so that when people click it, it loads posts under each category. I planned to launch my app by 17th of this month and this is the only functionality that remains
@saidulalam28406 жыл бұрын
hi, i am using laravel 5.6. i got a problem with auth:api. show Status Code: 401 Unauthorized. please help me.thanks
@akas_rai6 жыл бұрын
I wanted to authenticate api with api_token and I have multiple auth system with different role. The api should only be accessed by admin group and selected role admin. For that I have done as follows in ApiController public function __construct() { $this->middleware('auth:admin'); // for admin authentication $this->middleware('superadmins'); //only superadmins role can access api } API url are all fine but i get error with above two lines. It says {"error":"unauthenticated."} But if i remove those middleware it works fine without authentication Note: I haven't used laratrust, all middleware are created manually
@skell_jams7 жыл бұрын
Oh is this still happening
@timothyanderson95835 жыл бұрын
8:50 - If I were drinking milk, it would have squirted out my nose.
@joegoodman43584 жыл бұрын
if the token doesn't save with the other data, maybe you forgot to specify that api_token is a fillable attribute in your User.php file
@samerhameed3207 жыл бұрын
Hi Sir, First of all, a great thank for you amazing video that did, it’s really useful. I have a question about a Rest API, I will tell you what I am planning to do I have main application build with Laravel, it’s the main have all the data, and also have clients I want to install small application in their local server also build by laravel, to work locally and no need for internet access. What I am planning to do, is to make the client application talk with main application and fetch all the updated data, and the client application sends some data to the main application. As I know OAuth2 is the best way to make secure channel between two applications, if you have some video you made, and it may help me, please kindly share it with me. Or you may help by some advice. (I already try to do it, but I got some problem and error and I am not sure if I am using the right way to do it)