Calculate Difference
if (! function_exists('calculatePercentage')) {
/**
* Calculates the percentage between the given values.
*
* @param int|string $previous
* @param int|string $current
*
if (! function_exists('calculatePercentage')) {
/**
* Calculates the percentage between the given values.
*
* @param int|string $previous
* @param int|string $current
*
If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.
However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.
This is where this macro comes in handy.
This was tested on:
Open the file app/config/session.php
and change the driver
to database
.
We need to create the sessions
table, so use the following artisan command
php artisan session:table
to generate the migration file.