Learning Laravel: Protected Routes and Authentication

Previously in this series, we have looked at how to install laravel, how laravel works, and how to deploy a laravel app.  In today’s post, we are going to look at how you would protect a route so that the user would need to login in order to view a webpage.

Continue reading "Learning Laravel: Protected Routes and Authentication"

Learning Laravel: Composer and The Laravel Installer

I spent years writing Laravel code at UWM but you might have noticed that I almost never wrote anything on this blog about it.  I am hoping to address that here and now.  If you don’t already know, Laravel is a free, open-source PHP web framework, intended for the development of web applications following the …

Continue reading "Learning Laravel: Composer and The Laravel Installer"

PHP function of the day: array_rand()

For day 20 of 21 in the “PHP Function of the day” series, I’m going to look at array_rand().  The function takes a required array and an optional number of random keys to return.  It returns a random key (not the value). Let’s take a look. <?php $names = array(“Joe”,”Jim”,”Sarah”,”Jill”); $numbers = array(1,2,3,4,5,6,7,8,9); $names_rand_keys = array_rand($names,3); $numbers_rand_keys …

Continue reading "PHP function of the day: array_rand()"

PHP function of the day: date_diff()

For day 19 of 21 in the “PHP Function of the day” series, I’m going to look at date_diff(). Let’s take a look. <?php $shoppingDay=date_create(“2020-05-28”); $payDay=date_create(“2020-06-01”); $difference = date_diff($shoppingDay,$payDay); print_r($difference); echo “<br /><br />”.$difference->format(“%R%a days”); ?>   See the output   As you an see, this calculates the difference between two dates (something that could be pretty …

Continue reading "PHP function of the day: date_diff()"