Skip to content

Tag: laravel

Undefined variable ‘count’

I haven’t done PHP in a while so I’m a bit confused why I am getting the error in the title Answer You have to use use, described in docs(http://php.net/manual/en/functions.anonymous.php): Closures may also inherit variables from the parent scope. Any such variables must be declared in the functio…

Accessing Laravel .env variables in blade

I am trying to get some API keys which I have stored in my .env file to use in the blade javascript. I have added two keys like: In blade I need to use the Google Maps API and OverheidIO API key. I have tried getting one of the default .env variables just in case I have formatted the custom

preventing abuse of API service usage

I am planning on using Laravel in my next web project, for the backend. Using the Laravel’s built-in functionality I will build an API service. So my main concern now – is about the security of such service. Laravel’s API throttling middleware seems to be an easy to use solution, but it does…

Laravel 5.4 required if validation issue

I have 2 fields, accepts_usd and price_usd. For price usd I have a validation rule: And for accepts_usd: When I want to store data if I set accepts_usd to false it still asks for price_usd. whats the issue here? What am I doing wrong? Answer From laravel docs: required_if:anotherfield,value,… The field …