Laravel 5 - RateLimit per IP address - laravel-5

I am now building REST API using Laravel 5.
Now, I am going to limit the number of request in a given time period from the same IP Address.
I want to implement it in middleware.
Of course, there are many samples, but they are one for Laravel 4. They can't by applied to Laravel 5.
Please help me.
Thanks.

In Laravel 5.2 this is built in as middleware.
https://laracasts.com/series/whats-new-in-laravel-5-2

There is already a package for this. Check out https://github.com/GrahamCampbell/Laravel-Throttle. It is a rate limiter for Laravel 5, implemented via middleware.

Related

Laravel Vapor for API and Nova

I wonder about the possibility to use Vapor for an API (which will be called from a separate web app) and Nova. But I wonder if Vapor is made for that given that there is a limitation on the number of concurrent calls and also that Nova seems to make many calls. I don't want to start on a solution if I'm blocked afterwards because too many lambdas are executed due to a too big number of users.
I would have liked to know if there is something which escapes me about Vapor or if it is not the adapted solution and that it is preferable to leave with Forge for example.

how to use laravel cashier in order to handle recurring subscription in laravel

I am new to laravel currently using the laravel 5.8 . i have the subscriptions plans to be implemented in my laravel project. I have read about how to implement subscription and came across the laravel cashier i have tried to implement it. but it gives me error i do not know where these errors as i have implemented the code according to the documentation. Can anyone please suggest me the proper working example of how to use the laravel cashier in my project.
thanks
tried to implement laravel cashier
Stripe \ Error \ InvalidRequest
This customer has no attached payment source
sometimes it says trying to call created method on null
You’re trying to create a charge for a user that doesn’t have a credit card saved.
you can follow this example

Lonic 3 with laravel backend

So, I am going to create an ionic 3 project that use my existing laravel backend. My laravel project is on heroku (for now) and it is already setup with laravel passport and API based in mind, since I already created frontend for laravel with SPA vuejs and already configured cors too.
So I supposed it shouldn't be any problem from my backend to communicated with client side. But I am not very experienced with ionic 3, and the problem is I can't find any one talking straight forward about how to implement basic authentication with laravel passport to ionic 3 and also the basic http request like post, get, delete, and put/patch.
Most of the tutorials are about working with firebase, and me myself is not very familiar with firebase and not willing to invest time to those since all my backend needs are already satisfied with laravel. I also found 1 or 2 site talking about laravel and ionic but i think it is from very different version of ionic since the file structure and the way he working is very different from what I've known (beside those article already 1-2 years old now)
So maybe anyone that have a tutorial about all this thing can share it to me?

Laravel: Understanding which api framework to choose

Our company is about to start a real estate project and have decided to go with the laravel 5.3 framework. The first phase is to write the apis and then these apis will be consumed by the mobile team and the frontend team to build the official mobile app and the web portal respectively.
Now I am confused whether to use laravel's built-in Resource controllers (as instructed in this tutorial http://www.programmableweb.com/news/how-to-build-restful-apis-using-php-and-laravel/how-to/2014/08/13) or use the Dingo Api framework.
Could you please help me which one should I go for and why as per the requirements i mentioned above?
Thanks in advance
Since, Laravel 5.3 comes with Passport (for api authentication), I would suggest you to use Resource controller, which is very simple and easy to work with, and also it create a meaningful end points
Route::resource('post','PostController');
GET /post/{post}
POST /post
EDIT /post/{post}/edit
DELETE /post/{post}

What is the difference between laravel and lumen

Taylor Otwell recently released a new framework called Lumen. I am a big user of Laravel.
Can any one point out the difference between Laravel and Lumen micro framework.
What is micro framework all about and when should one use it.
Laravel is doing quite a lot of initialization during each request. With Lumen processing each request is much faster so it is supposed to be able to handle even more load than Laravel with all its caching.
This means that Lumen is less configurable but is able to handle more requests per second.

Resources