{info} These are methods that are found in
helpers/base.php
.
This method is used to start a measurement with laravel debugbar. It will use the name and label passed to it in the measurement.
This method is used to stop a measurement with laravel debugbar. It will use the name passed to it to find the measurement.
This is a simple helper for displaying output when you need to debug code. It behaves very similarly to laravel’s dump()
method. If you pass return as true, it will return the output directly, otherwise it will echo it.
This is the same as pp
but it adds a die
at the end. This is similar to laravel’s dd()
method (but not as pretty).
The goal of this method is to convert an object into an array. It will set the key of each array element as a snake_case()
of the property name.
{info} These helper methods are aimed at making guzzle calls easier to perform by handling the basic things for you. They are found in
helpers/api.php
.
For this method, pass it the results of your call to guzzle (GET, POST, etc). It will then wrap the results in a
App\Models\Simple
model for ease of use. If you pass the tap
parameter, it will get that property from the results and
pass that to the model instead.
Similar to the previous method, this will return the results of your call as a collection of Simple models. All other details from the previous call apply.
{info} These are all methods that will help you with common math needs. They are found in
helpers/math.php
.
This method will return the percent $num_amount
is of $num_total
. It does not add the %
string.
This method will return the decimal $num_amount
is of $num_total
to the $round
decimal place.
This method will give you the number and it’s ordinal suffix. For example, passing 1
would return 1st
.
{info} These are all methods that will help you with common number tasks. They are found in
helpers/numbers.php
.
As the name suggests, this will convert your number into string roman numerals.
{info} These are all methods that will help you with common string tasks. They are found in
helpers/strings.php
.
This will convert a string to capitalized snake case. For example Hello world
would become Hello_World
.
This method will perform an implode on your array, but it will add $separator
before the last entry.
$array = [
'Tom',
'Bill',
'Sam',
];
echo humanReadableImplode($array);
The above code would output Tom, Bill and Sam
.
This method will run json_deode
on your string, then use json_last_error
to figure out what actually happened and return
any error in a much more human readable way.
{info} These are all methods that will help you with time conversions and ranges. They are found in
helpers/time.php
.
This method is used extensively in our default Models. It will take the time you give it and do a few things.
user_details
table.This is the counterpart to setTime()
. This method will convert the time from UTC into either the app timezone or the
user’s if they are logged in.
This is basically a shorthand for \Carbon\Carbon::parse($time)
. However, if a user is logged in, it will set the carbon
object to the user’s timezone.
This method will convert a time signature (HH:MM:SS) into seconds by splitting the string and multiplying to get the number of seconds that time would be.
Alternately, this will take a number of seconds and tell you how many weeks, days, hours, minutes and remaining seconds it equates to.
This is similar to the above, but it is more readable. The output would be something like 2 days 10 hours 43 minutes
and 2 seconds
.
{info} All database helper methods are found in
helpers.php
.
This is a helper method to create a new \App\Collections\EloquentCollection
with your value supplied.
This is a helper method to create a new \App\Collections\SupportCollection
with your value supplied.
{info} All menu helper methods are found in
helpers.php
.
This is a helper method for creating a new menu container or finding one that already exists with the $menuName
.
{info} All view resolution helper methods are found in
helpers.php
.
This is a quick helper to get the ViewResolver out of the app container.
This is a quick helper to get the InertiaResolver out of the app container.
All this method does is check is the app is in local env and has the debugbar bound. This is used throughout the package to only take actions with the debug bar when it is necessary.