follow @NathanCruz

0 Following  •  0 Followers

Nathan Cruz

Timeline

Started
webdeveloper.com profile
08.2022
How do I set a variable in a Blade template?

How can I set a variable on the fly in a blade template? I know I can pass it from a controller, but how do I set it up directly in the template on the fly?

Tweet This Post This Share This
Easy way of getting a random integer in a specific range in JavaScript?

I have two values, let’s say 2 and 9 and I’d like to get a random number between the two (including those two), is there an easy way to do this?

Tweet This Post This Share This
How can I create a multiline string in JavaScript?

I’ve tried to create a multiline string, but other than concatenating, I cannot think of any other way.

Tweet This Post This Share This
Laravel app throwing MethodNotAllowedHttpException on one link

Has anyone experienced this? How do I fix it?

Tweet This Post This Share This
How can I redirect to the original destination after login?

My Laravel application has a functioning login logic and routes are protected from being accessed by an authentication middleware, however, I’d like for the users to be able to be redirected to their original destination after getting logged in.

Tweet This Post This Share This
How to pass data to all views in Laravel?

I have some data that I want to share with all the views of my application, without repeating the code on each return of a view in the controller. I’ve found the snippet <code> View::share(‘data’, [1, 2, 3]); </code>, but I’m not sure where to place this?

Tweet This Post This Share This
Joined Aug 2022
Sign in
Forgot password?
Sign in with TwitchSign in with Github