Skip to main content

Posts

Showing posts from January, 2022

Laravel Sanctum - Restful API Authentication

In this article, we will discuss "Laravel Sanctum - Restful API Authentication" . Laravel Sanctum provides a simple authentication system for mobile applications, SPA (Single Page Application), and token-based API. We can generate multiple API tokens for the user account. Also, we can assign abilities/scopes which specify which actions the tokens are allowed to perform. For example, we can assign abilities as per the user roles. Laravel Sanctum or Laravel Passport ? Passport provides a complete solution for OAuth2 authentication. If OAuth is not required in your project then Sanctum is right for your application. Sanctum is light and easy to implement. Prerequisites Knowledge of Laravel, you can check our other post on Laravel . Basic knowledge of HTTP client postman. You are free to use any of HTTP client, s Getting Started Let's setup a new Laravel application, use the following composer command into the terminal. composer create-project laravel/laravel la...

How to Upload File to AWS S3 Bucket Laravel

In this article, we will discuss "How to Upload File to AWS S3 Bucket Laravel" . It's known as Amazon Simple Storage Service and an object storage service that offers scalability, security, performance, and data availability. We can use AWS S3 Bucket to store and retrieve any amount of data at any time. Data is stored as objects in S3 Buckets. You have to check the pricing of the AWS S3 bucket . Also, AWS provides us the S3 bucket 5GB standard storage under a free tire for 12 months. Prerequisites AWS Account AWS Management Console Access Basic knowledge of AWS, If you are new to AWS then read service pricing properly. Otherwise, AWS charges your card when the free tier limit is crossed. IAM User (Check my  previous post ) Create AWS S3 Bucket Login with the AWS Management Console and go to the S3 bucket dashboard. Click on the Create bucket button, then you are redirected to the next step. Here, you have to add the Bucket name. You can apply encryption, versi...