The Cartesian module provide methods for the calculation of the cartesian producted between two enumerable objects.
It can also be easily mixed in into any enumerable class, i.e. any class with Enumerable module mixed in. Notice that the names of the methods for mixin are different.
Module:
Cartesian::product(foo, bar)
Mixin:
foo.cartesian( bar )
The module is automatically mixed in Array class.
Adriano MITRE
as module
require 'cartesian' foo = [1, 2] bar = ["a", "b"] Cartesian::product(foo, bar) #=> [[1, "a"], [1, "b"], [2, "a"], [2, "b"]]
as mixin
require 'cartesian' foo = [1, 2] bar = ["a", "b"] foo.cartesian(bar) #=> [[1, "a"], [1, "b"], [2, "a"], [2, "b"]]
Unfortunately, as of now, the version data must be replicated in ../cartesian.rb, due to a mix of newgem versions, each requiring a different one. Not DRY :P
Behaves as product, except for the elements are joined.
Cartesian::joined_cartesian( [1,2], %w(A B) ) #=> ["1A", "1B", "2A", "2B"]
or, if mixed in into Array,
[1,2].joined_cartesian %w(A B) #=> ["1A", "1B", "2A", "2B"]
# File lib/cartesian.rb, line 65 65: def Cartesian.joined_product(first, second) 66: product(first, second).map {|pair| pair.join } 67: end
Produces the cartesian product of self and other. The result is an array of pairs (i.e. two-element arrays).
Cartesian::product( [1,2], %w(A B) ) #=> [[1, "A"], [1, "B"], [2, "A"], [2, "B"]]
or, if mixed in into Array,
[1,2].cartesian %w(A B) #=> [[1, "A"], [1, "B"], [2, "A"], [2, "B"]]
# File lib/cartesian.rb, line 53 53: def Cartesian.product(first, second) 54: first.x(second).to_a 55: end
Concise way of iterating multi-dimensionally over the same array or range.
For instance,
for x,y,z in [0,1]**3 puts [x, y, z].join(',') end
produces the following output
0,0,0 0,0,1 0,1,0 0,1,1 1,0,0 1,0,1 1,1,0 1,1,1
It also works with Range objects.
# File lib/cartesian.rb, line 143 143: def **(fixnum) 144: if fixnum < 0 145: raise ArgumentError, "negative power" 146: elsif fixnum == 0 147: return [] 148: elsif fixnum == 1 149: return self 150: else 151: iter = CartesianIterator.new(self, self) 152: (fixnum-2).times do 153: iter.product!(self) 154: end 155: iter 156: end 157: end
Cartesian.joined_product for mixin.
# File lib/cartesian.rb, line 71 71: def joined_cartesian(other) 72: Cartesian.joined_product(self, other) 73: end
# File lib/cartesian.rb, line 112 112: def left_product(other) 113: case other 114: when CartesianIterator 115: other.right_product(self) 116: else 117: CartesianIterator.new(other, self) 118: end 119: end
Convenient way of iterating over the elements. Preferable when the cartesian product array is not needed, for the consumption of memory is fixed and very small, in contrast with the exponential memory requirements of the conventional approach.
for row, col in (1..10).x(1..30) Matrix[row, col] = row**2 + col**3 end
Of course, calls can be chained as in
for x, y, z in (1..10).x(1..10).x(1..10) # ... do something ... end
Beware that both self and other must implement to_a, i.e., be convertible to array.
# File lib/cartesian.rb, line 101 101: def x(other) 102: case other 103: when CartesianIterator 104: other.left_product(self) 105: else 106: CartesianIterator.new(self, other) 107: end 108: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.


This field need to be populated with Any job names(starting value is sufficient no need of entire job name) that need to be excluded from publishing the data to Hygieia. This field can take multiple values separated by ,
If you do not require any builds to be excluded leave this field blank.


"Annual income twenty pounds, annual expenditure nineteen pounds nineteen and six, result happiness. Annual income twenty pounds, annual expenditure twenty pounds nought and six, result misery." - Wilkins Micawber


I was very playful ever since I was a kid. When my family bought a computer. My first ever game was DOTA. And became addicted to the computer
I widen my choice of games, MOBA, FPS, RPG, and even Simulations. I played on the computer and even consoles like PS2, PS3, PS4, and XBOX360.
For me, these games are help me relax, find my focus, and practice my mind. I may be addictive to it but I know my priorities straight.


Leviathan
Gargantuan elemental, neutral
Armor Class 17
Hit Points 328 (16d20 + 160)
Speed 40 ft., swim 120 ft.
| STR | DEX | CON | INT | WIS | CHA |
|---|---|---|---|---|---|
| 30 (+10) | 24 (+7) | 30 (+10) | 2 (-4) | 18 (+4) | 17 (+3) |
Saving Throws Wis +10, Cha +9
Damage Resistances bludgeoning, piercing, and slashing from nonmagical attacks
Damage Immunities acid, poison
Condition Immunities exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, stunned
Senses darkvision 60 ft., passive Perception 14
Languages -
Challenge 20 (25,000 XP)
Legendary Resistance (3/Day). If the leviathan fails a saving throw, it can choose to succeed instead.
Partial Freeze. If the leviathan takes 50 cold damage or more during a single turn, the leviathan partially freezes; until the end of its next turn, its speeds are reduced to 20 feet, and it makes attack rolls with disadvantage.
Siege Monster. The leviathan deals double damage to objects and structures (included in Tidal Wave).
Water Form. The leviathan can enter a hostile creature’s space and stop there. It can move through a space as narrow as 1 inch wide without squeezing.
Actions
Multiattack The leviathan makes two attacks: one with its slam and one with its tail.
Slam Melee Weapon Attack: +16 to hit, reach 20 ft., one target. Hit: 15 (1d10 + 10) bludgeoning damage plus 5 (1d10) acid damage.
Tail Melee Weapon Attack: +16 to hit, reach 20 ft., one target. Hit: 16 (1d12 + 10) bludgeoning damage plus 6 (1d12) acid damage.
Tidal Wave (Recharge 6) While submerged, the leviathan magically creates a wall of water centered on itself. The wall is up 250 feet long, up to 250 feet high, and up to 50 feet thick. When the wall appears, all other creatures within its area must each make a DC 24 Strength saving throw. A creature takes 33 (6d10) bludgeoning damage on failed save, or half as much damage on a successful one. At the start of each of the leviathan’s turns after the wall appears, the wall, along with any other creatures in it, moves 50 feet away from the leviathan. Any Huge or smaller creature inside the wall or whose space the wall enters when it moves must succeed on a DC 24 Strength saving throw or take 27 (5d10) bludgeoning damage. A creature takes this damage no more than once on a turn. At the end of each turn the wall moves, the wall’s height is reduced by 50 feet, and the damage creatures take from the wall on subsequent rounds is reduced by 1d10. When the wall reaches 0 feet in height, the effect ends. A creature caught in the wall can move by swimming. Because of the force of the wave, though, the creature must make a successful DC 24 Strength (Athletics) check to swim at all during that turn.
Legendary Actions
The leviathan can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature’s turn. The leviathan regains spent legendary actions at the start of its turn.
Slam (Costs 2 Actions) The leviathan makes one slam attack.
Move The leviathan moves up to its speed.


Intel® Core™ Processors. Intel Inside®.
Extraordinary Performance Outside.
pre-built with the features you
need and want. Ships next
business day.
Ready-to-
Ship PCs
Our most powerful spectre yet.
Starting at $1279.99
New Spectre
X360
Your limits redefined.
Starting at $699.99
HP Envy
View All
Laptops
Business
Premium
Great
Entry level
Gaming
The functionality of a traditional laptop with the portability of a tablet
Amazing laptops & tablets at prices to love.
HP Inc. creates technology that makes life better for everyone, everywhere. HP Inc. has a laptop for every lifestyle.
Looking for a great value or laptop deals? The HP Pavilion Laptop comes loaded with the features you need to< make the most of every spark of inspiration. If you need versatility, HP's 2 in 1
laptops are thin, light and versatile and delivers the battery life to get it done. HP and Pavilion X360 offer 4 modes of operation, but Spectre and Envy X360 families may be considered our best
2 in 1 laptops. The award-winning HP Spectre premium 360 is convertible with next-level features that give you all-day portability in a stunning, ultra-thin design.
For all our gamers out there, our quad core Pavilion laptops are popular among casual gamers, but consider the HP Omen family gaming laptops. With the HP Omen laptop, our best gaming
laptop yet, get ready for the battlefield, anytime, anywhere. And across all of HP laptops products, we offer touch screen laptops, whether you prefer entry level, great value or hp premium
laptops. Easily find the best touch screen laptops and other features to fit your needs. Check out our top laptops on sale.


I'm a graphic designer based out of the Bay Area and I enjoy finding solutions to design challenges. There's always something exciting about exploring branding ideas and creating new meanings to older design aesthetics. The focus of my work is largely branding and web design, but I also can't pass up the chance to illustrate something on paper.


Soundbox
Incorrect username or password.
Submit
Sort By
Added On Date
Play Count
Track Type
All
Mixes
Tracks
Listened
Unlistened (
)
Listened (
)


Created: 12/01/2019
By: Nikolay Hadjidimitrov
Email<EMAIL_ADDRESS>Thank you for purchasing my extension. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here.
LiveSmart Video Chat is a standalone web application with video, audio, recording, screensharing and file transfer face-to-face communication channels and integrated chat. It has own push notification server, that is based on Socket.io or Rachet PHP websocket libraries. It does not require any additional installations or third party logins and accounts. The contact button can be set on your web site and give you information about your visitors. They can directly call you if you are online.
LiveSmart Video Chat is supported on all major browsers:
- Desktop PC. Microsoft Edge 12+, Google Chrome 28+, Mozilla Firefox 22+, Safari 11+, Opera 18+, Vivaldi 1.9+, IE 11 (Needs installation of Temasys plugin. You will be guided through the installation process)
- Android. Google Chrome 28+ (enabled by default since 29), Mozilla Firefox 24+, Opera Mobile 12+
- Chrome OS.
- Firefox OS.
- Blackberry 10.
- at least iOS 11. MobileSafari/Mac Safari. For legacy Safari (older than v.11) you will be prompted to install Temasys plugin.
- Live video and/or audio chat;
- Multi user conference video sessions;
- Whiteboard;
- Broadcast to many;
- Configurable entry form available both with front end access (from the agent) or PHP and MySQL scripting;
- Own notification server, no third party software or accounts needed;
- File transfer;
- Record every aspect of your live stream - video, screen share, whiteboard and chat;
- Private rooms;
- Snapshot;
- URL shortener;
- Offline form so never miss a customer inquiry;
- Pure HTML5 Web chat;
- Chat history;
- Voice to chat module;
- Screen sharing. Supported on Chrome up to 71 with additional plugin (Your will be guided in the installation process),
Chrome 72+, Firefox 52+ and MS Edge 17+ browsers are pluginless;
- Switch between front and back camera of your mobile;
- Notification system;
- Mobile friendly;
- Button for establishing a direct connection and a facility to track the presence of your visitors;
- Predefined buttons styling;
- Internationalization;
- Ability to set own video chat room;
- Meeting Scheduling;
You can check the User Guide section for a detailed description of all the features.
- HTTPS (SSL certificate) needed;
- For server side scripts: at least Node 4.0 or PHP 5.4 needed;
- You can set own TURN server (recommended) or use the Google default STUN servers.
- No DB needed;
Possible usages:
- Set an online/offline contact button on your site and track and contact your visitors;
- Set a private room and share it with your contacts in order to establish a direct video call with screen sharing and file transfer;
- Switch between front and back camera of your mobile to make an outstanding demo for your customers;
- Use only chat for support and fun;
Check here available scenarios of usage!
- All kind that can use peer-to-peer video communication on most of the browsers;
- Tech support. Share screen or transfer files with your troubled customers;
- Health care consultations;
- Online sales;
- Real estate agents;
- Car resellers;
Installation process
Front-end tutorial
Installation Guide
FAQ Section
Live Demo
Meeting Scheduling Demo
Whiteboard Demo
Multi User Conference with Enabled Recording
Password Protected Form
Live Iframe Demo
Speech Recognition Demo
Translation Demo
Chat Engagement Demo
If you have questions or requirements, please send email to<EMAIL_ADDRESS>with a description of the problem and the system you are using - backend (Node.js or PHP, libraries, versions, error logs), browser name and version and if possible console logs, OS.
v2.0.8 - Apr 29, 2020 - New experimental FFmpeg transcoder added. It helps you to convert your recorded video/audio files from WEBM to MP4; - New Recordings tab in the dashboard panel; - New small features - possibility to add visitor name in the contact button and define default starting camera for mobiles; v2.0.8 - Apr 16, 2020 - New agent panel with better UI; - Broadcasting available with video from attendee; - Optimization work; - UI changes; v2.0.7 - Apr 10, 2020 - Fixes for Edge browser; - Fixes in admin panel; - Small UI changes; v2.0.6 - Mar 21, 2020 - pro-active chat is kept in history; - fixes and cleanup of broadcasting; v2.0.5 - Mar 21, 2020 - pro-active engagement chat; - attendees can join without camera and/or microphone; v2.0.4 - Mar 8, 2020 - translation module; - snapshot capturing; - bug fixes; v2.0.2 - v.2.0.3 - Feb 26, 2020 - added speech recognition module; - bug fixes; v2.0.1 - Feb 9, 2020 - added a new UI with zoom like features; - new enhanced signaling server with better video conferencing; - better reconnect logic; - file transfer to multiple users; - bug fixes; - old UI is kept, with the updated server; v1.0.23 - Oct 2, 2019 - Possibility to auto accept call; - Room generation with disabled video/audio/whiteboard, screenshare or file transfer; - Multi conference fixes; v1.0.22 - Sept 16, 2019 - Broadcasting improvements; - Recording of all the streams - video/audio/screen share/whiteboard and chat; - Feedback form; - Audio and video quality; - Bug fixes;


Clean layout, Bulma CSS, Tooling: Gulp, SaaS, FTP deploy script. License: MIT
Beautiful Design
Blazing Fast. And Free
Tooling
We have clients all over the world and more than 10 years experience in the market.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's


This adapter allows the use of date-fns with Chart.js.
Requires Chart.js 2.8.0 or later and date-fns 2.0.0 or later.
Note: once loaded, this adapter overrides the default date-adapter provided in Chart.js (as a side-effect).
By default, https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns@next
returns the latest (minified) version, however it’s highly recommended to always specify a version in order to avoid breaking changes. This can be achieved by appending @{version}
to the url:
<script<EMAIL_ADDRESS><script<EMAIL_ADDRESS>Read more about jsDeliver versioning on their website.
date-fns requires a date-fns locale object to be tagged on to each format()
call, which requires the locale to be explicitly set via the adapters.date
option: Chart.js documentation on adapters.date
For example:
// import date-fns locale:
import { de } from "date-fns/locale";
// scale options:
{
adapters: {
date: {
locale: de;
}
}
}
Further, read the Chart.js documentation for other possible date/time related options. For example, the time scale time.*
options can be overridden using the date-fns tokens.
You first need to install node dependencies (requires Node.js):
The following commands will then be available from the repository root:
chartjs-adapter-date-fns
is available under the MIT license.


INSPECTOR GADGET A film review by Christopher Null Copyright 1999 Christopher Null filmcritic.com
I'll admit to watching the early 1980's `Inspector Gadget' cartoon, and probably far too late in life.
Looks like now I'm waaaaay too old for this kind of thing, but judging by the mute stares of the many children in our advance screening audience, maybe they are too.
INSPECTOR GADGET – the live-action version starring Matthew Broderick in a thankless slapstick role – tries so hard to be funny, aiming alternately at kids and their parents, that it misses on all counts. In one scene, Gadget will grab some guy's crotch until he squeals. In the next, the evil Dr. Claw (Everett) will pontificate on how his moniker is `One word, like Madonna.' Do kids get the subtlety of the joke, considering Everett is openly gay? Do adults think it's funny?
Nix on both counts, and the super-streamlined plot line (John Brown is injured and becomes superhuman crime-fighting machine) is stolen completely from ROBOCOP. How's that for your average kiddie movie?
Two funny items of note earn GADGET its half-star. First is the Minion Recovery Group scene, which appears during the closing credits. Second is actually up front, when a `Yahoo!' billboard crushes Claw's limo. Considering that Disney's Go network is now an arch-rival of Yahoo!, the free advertising for the competition (which likely wasn't an issue during the movie's original production) seems particularly ironic.
There I go again. Making my own humor.
RATING: *1/2
|------------------------------| \ ***** Perfection \ \ **** Good, memorable film \ \ *** Average, hits and misses \ \ ** Sub-par on many levels \ \ * Unquestionably awful \ |------------------------------|
MPAA Rating: PG
Director: David Kellogg Producer: Jordan Kerner, Roger Birnbaum, Andy Heyward Writer: Kerry Ehrin, Zak Penn Starring: Matthew Broderick, Rupert Everett, Joely Fisher, Michelle Trachtenberg, Andy Dick, Cheri Oteri, Dabney Coleman, Michael G. Hagerty
http://disney.go.com/DisneyPictures/gadget/index.html
Christopher Null -<EMAIL_ADDRESS>- http://www.filmcritic.com Author - Network Administrator's Reference, 1999, ISBN 0-07-882588-1 http://www.amazon.com/exec/obidos/ASIN/0078825881/filmcriticcom
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Have you ever been on the road, and needed to edit a Microsoft Word or Excel FIle and send it to a colleague in the office? Or going for a presentation and suddenly remembering your powerpoint is on the computer or not accessible?
You will learn how to use Mobile Tools to create and Edit your Office documents, convert to PDF, and even send to print, from your mobile device.
Would you like to learn how to design and develop Professional looking websites in as little as 4 weeks?
Our Web Development Training teaches you HTML, CSS, JavaScript, and BootStrap within a four weeks period.
At the end of Class, you would have developed a Project using the modern web development skills you learnt in Class.
Our Social Media and Digital Marketing Training covers Social Media Management, Social Profiling, Social Media Advertising, Search Engine Optimization, Social Mentions, Search Engine Marketing, and Website Traffic Analysis.
We will train your team on how to collectively contribute to Brand exposure and Online Sales of your products and Services, and how they can work together to ensure that your brand continues to enjoy positive digital visibilityBecome a full fledged programmer, take our Laravel (PHP framework) or Django (Python framework) course today and start developing powerful applications with modern cutting Edge technologies.
Python is becoming one of the world's most popular programming languages and is used extensively in Artificial Intelligence and Data Sciences (Python most popular Language), while PHP is currently used by 79.0% of all the websites on the Internet (PHP Web Share), making it the most used programming language for websites


Open Data OpenStreetMap and You
Open Data Rocks!!
OpenStreetMap
Rocks Hard!!
Look at all that open data out there
And It's
Authoritative
So, you can
use it to
EDIT....
Feature / Map / Image
services as custom backgrounds in iD
Use ALF to fix zoom levels and create tile url's
...or you can use it to IMPORT
☑ Gotta Want It
☑ Friends
☑ Follow The Rules
Thanks!


Helpers
Introduction
Laravel includes a variety of global "helper" PHP functions. Many of these functions are used by the framework itself; however, you are free to use them in your own applications if you find them convenient.
Available Methods
Arrays & Objects
Paths
Strings
Fluent Strings
URLs
Miscellaneous
Method Listing
Arrays & Objects
Arr::accessible()
{#collection-method .first-collection-method}
The Arr::accessible
method determines if the given value is array accessible:
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
$isAccessible = Arr::accessible(['a' => 1, 'b' => 2]);
// true
$isAccessible = Arr::accessible(new Collection);
// true
$isAccessible = Arr::accessible('abc');
// false
$isAccessible = Arr::accessible(new stdClass);
// false
Arr::add()
{#collection-method}
The Arr::add
method adds a given key / value pair to an array if the given key doesn't already exist in the array or is set to null
:
use Illuminate\Support\Arr;
$array = Arr::add(['name' => 'Desk'], 'price', 100);
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add(['name' => 'Desk', 'price' => null], 'price', 100);
// ['name' => 'Desk', 'price' => 100]
Arr::collapse()
{#collection-method}
The Arr::collapse
method collapses an array of arrays into a single array:
use Illuminate\Support\Arr;
$array = Arr::collapse([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
Arr::crossJoin()
{#collection-method}
The Arr::crossJoin
method cross joins the given arrays, returning a Cartesian product with all possible permutations:
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin([1, 2], ['a', 'b']);
/*
[
[1, 'a'],
[1, 'b'],
[2, 'a'],
[2, 'b'],
]
*/
$matrix = Arr::crossJoin([1, 2], ['a', 'b'], ['I', 'II']);
/*
[
[1, 'a', 'I'],
[1, 'a', 'II'],
[1, 'b', 'I'],
[1, 'b', 'II'],
[2, 'a', 'I'],
[2, 'a', 'II'],
[2, 'b', 'I'],
[2, 'b', 'II'],
]
*/
Arr::divide()
{#collection-method}
The Arr::divide
method returns two arrays: one containing the keys and the other containing the values of the given array:
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide(['name' => 'Desk']);
// $keys: ['name']
// $values: ['Desk']
Arr::dot()
{#collection-method}
The Arr::dot
method flattens a multi-dimensional array into a single level array that uses "dot" notation to indicate depth:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot($array);
// ['products.desk.price' => 100]
Arr::except()
{#collection-method}
The Arr::except
method removes the given key / value pairs from an array:
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except($array, ['price']);
// ['name' => 'Desk']
Arr::exists()
{#collection-method}
The Arr::exists
method checks that the given key exists in the provided array:
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists($array, 'name');
// true
$exists = Arr::exists($array, 'salary');
// false
Arr::first()
{#collection-method}
The Arr::first
method returns the first element of an array passing a given truth test:
use Illuminate\Support\Arr;
$array = [100, 200, 300];
$first = Arr::first($array, function ($value, $key) {
return $value >= 150;
});
// 200
A default value may also be passed as the third parameter to the method. This value will be returned if no value passes the truth test:
use Illuminate\Support\Arr;
$first = Arr::first($array, $callback, $default);
Arr::flatten()
{#collection-method}
The Arr::flatten
method flattens a multi-dimensional array into a single level array:
use Illuminate\Support\Arr;
$array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']];
$flattened = Arr::flatten($array);
// ['Joe', 'PHP', 'Ruby']
Arr::forget()
{#collection-method}
The Arr::forget
method removes a given key / value pair from a deeply nested array using "dot" notation:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::forget($array, 'products.desk');
// ['products' => []]
Arr::get()
{#collection-method}
The Arr::get
method retrieves a value from a deeply nested array using "dot" notation:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$price = Arr::get($array, 'products.desk.price');
// 100
The Arr::get
method also accepts a default value, which will be returned if the specified key is not present in the array:
use Illuminate\Support\Arr;
$discount = Arr::get($array, 'products.desk.discount', 0);
// 0
Arr::has()
{#collection-method}
The Arr::has
method checks whether a given item or items exists in an array using "dot" notation:
use Illuminate\Support\Arr;
$array = ['product' => ['name' => 'Desk', 'price' => 100]];
$contains = Arr::has($array, 'product.name');
// true
$contains = Arr::has($array, ['product.price', 'product.discount']);
// false
Arr::hasAny()
{#collection-method}
The Arr::hasAny
method checks whether any item in a given set exists in an array using "dot" notation:
use Illuminate\Support\Arr;
$array = ['product' => ['name' => 'Desk', 'price' => 100]];
$contains = Arr::hasAny($array, 'product.name');
// true
$contains = Arr::hasAny($array, ['product.name', 'product.discount']);
// true
$contains = Arr::hasAny($array, ['category', 'product.discount']);
// false
Arr::isAssoc()
{#collection-method}
The Arr::isAssoc
returns true
if the given array is an associative array. An array is considered "associative" if it doesn't have sequential numerical keys beginning with zero:
use Illuminate\Support\Arr;
$isAssoc = Arr::isAssoc(['product' => ['name' => 'Desk', 'price' => 100]]);
// true
$isAssoc = Arr::isAssoc([1, 2, 3]);
// false
Arr::last()
{#collection-method}
The Arr::last
method returns the last element of an array passing a given truth test:
use Illuminate\Support\Arr;
$array = [100, 200, 300, 110];
$last = Arr::last($array, function ($value, $key) {
return $value >= 150;
});
// 300
A default value may be passed as the third argument to the method. This value will be returned if no value passes the truth test:
use Illuminate\Support\Arr;
$last = Arr::last($array, $callback, $default);
Arr::only()
{#collection-method}
The Arr::only
method returns only the specified key / value pairs from the given array:
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100, 'orders' => 10];
$slice = Arr::only($array, ['name', 'price']);
// ['name' => 'Desk', 'price' => 100]
Arr::pluck()
{#collection-method}
The Arr::pluck
method retrieves all of the values for a given key from an array:
use Illuminate\Support\Arr;
$array = [
['developer' => ['id' => 1, 'name' => 'Taylor']],
['developer' => ['id' => 2, 'name' => 'Abigail']],
];
$names = Arr::pluck($array, 'developer.name');
// ['Taylor', 'Abigail']
You may also specify how you wish the resulting list to be keyed:
use Illuminate\Support\Arr;
$names = Arr::pluck($array, 'developer.name', 'developer.id');
// [1 => 'Taylor', 2 => 'Abigail']
Arr::prepend()
{#collection-method}
The Arr::prepend
method will push an item onto the beginning of an array:
use Illuminate\Support\Arr;
$array = ['one', 'two', 'three', 'four'];
$array = Arr::prepend($array, 'zero');
// ['zero', 'one', 'two', 'three', 'four']
If needed, you may specify the key that should be used for the value:
use Illuminate\Support\Arr;
$array = ['price' => 100];
$array = Arr::prepend($array, 'Desk', 'name');
// ['name' => 'Desk', 'price' => 100]
Arr::pull()
{#collection-method}
The Arr::pull
method returns and removes a key / value pair from an array:
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$name = Arr::pull($array, 'name');
// $name: Desk
// $array: ['price' => 100]
A default value may be passed as the third argument to the method. This value will be returned if the key doesn't exist:
use Illuminate\Support\Arr;
$value = Arr::pull($array, $key, $default);
Arr::query()
{#collection-method}
The Arr::query
method converts the array into a query string:
use Illuminate\Support\Arr;
$array = [
'name' => 'Taylor',
'order' => [
'column' => 'created_at',
'direction' => 'desc'
]
];
Arr::query($array);
// name=Taylor&order[column]=created_at&order[direction]=desc
Arr::random()
{#collection-method}
The Arr::random
method returns a random value from an array:
use Illuminate\Support\Arr;
$array = [1, 2, 3, 4, 5];
$random = Arr::random($array);
// 4 - (retrieved randomly)
You may also specify the number of items to return as an optional second argument. Note that providing this argument will return an array even if only one item is desired:
use Illuminate\Support\Arr;
$items = Arr::random($array, 2);
// [2, 5] - (retrieved randomly)
Arr::set()
{#collection-method}
The Arr::set
method sets a value within a deeply nested array using "dot" notation:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::set($array, 'products.desk.price', 200);
// ['products' => ['desk' => ['price' => 200]]]
Arr::shuffle()
{#collection-method}
The Arr::shuffle
method randomly shuffles the items in the array:
use Illuminate\Support\Arr;
$array = Arr::shuffle([1, 2, 3, 4, 5]);
// [3, 2, 5, 1, 4] - (generated randomly)
Arr::sort()
{#collection-method}
The Arr::sort
method sorts an array by its values:
use Illuminate\Support\Arr;
$array = ['Desk', 'Table', 'Chair'];
$sorted = Arr::sort($array);
// ['Chair', 'Desk', 'Table']
You may also sort the array by the results of a given closure:
use Illuminate\Support\Arr;
$array = [
['name' => 'Desk'],
['name' => 'Table'],
['name' => 'Chair'],
];
$sorted = array_values(Arr::sort($array, function ($value) {
return $value['name'];
}));
/*
[
['name' => 'Chair'],
['name' => 'Desk'],
['name' => 'Table'],
]
*/
Arr::sortRecursive()
{#collection-method}
The Arr::sortRecursive
method recursively sorts an array using the sort
function for numerically indexed sub-arrays and the ksort
function for associative sub-arrays:
use Illuminate\Support\Arr;
$array = [
['Roman', 'Taylor', 'Li'],
['PHP', 'Ruby', 'JavaScript'],
['one' => 1, 'two' => 2, 'three' => 3],
];
$sorted = Arr::sortRecursive($array);
/*
[
['JavaScript', 'PHP', 'Ruby'],
['one' => 1, 'three' => 3, 'two' => 2],
['Li', 'Roman', 'Taylor'],
]
*/
Arr::where()
{#collection-method}
The Arr::where
method filters an array using the given closure:
use Illuminate\Support\Arr;
$array = [100, '200', 300, '400', 500];
$filtered = Arr::where($array, function ($value, $key) {
return is_string($value);
});
// [1 => '200', 3 => '400']
Arr::wrap()
{#collection-method}
The Arr::wrap
method wraps the given value in an array. If the given value is already an array it will be returned without modification:
use Illuminate\Support\Arr;
$string = 'Laravel';
$array = Arr::wrap($string);
// ['Laravel']
If the given value is null
, an empty array will be returned:
use Illuminate\Support\Arr;
$array = Arr::wrap(null);
// []
data_fill()
{#collection-method}
The data_fill
function sets a missing value within a nested array or object using "dot" notation:
$data = ['products' => ['desk' => ['price' => 100]]];
data_fill($data, 'products.desk.price', 200);
// ['products' => ['desk' => ['price' => 100]]]
data_fill($data, 'products.desk.discount', 10);
// ['products' => ['desk' => ['price' => 100, 'discount' => 10]]]
This function also accepts asterisks as wildcards and will fill the target accordingly:
$data = [
'products' => [
['name' => 'Desk 1', 'price' => 100],
['name' => 'Desk 2'],
],
];
data_fill($data, 'products.*.price', 200);
/*
[
'products' => [
['name' => 'Desk 1', 'price' => 100],
['name' => 'Desk 2', 'price' => 200],
],
]
*/
data_get()
{#collection-method}
The data_get
function retrieves a value from a nested array or object using "dot" notation:
$data = ['products' => ['desk' => ['price' => 100]]];
$price = data_get($data, 'products.desk.price');
// 100
The data_get
function also accepts a default value, which will be returned if the specified key is not found:
$discount = data_get($data, 'products.desk.discount', 0);
// 0
The function also accepts wildcards using asterisks, which may target any key of the array or object:
$data = [
'product-one' => ['name' => 'Desk 1', 'price' => 100],
'product-two' => ['name' => 'Desk 2', 'price' => 150],
];
data_get($data, '*.name');
// ['Desk 1', 'Desk 2'];
data_set()
{#collection-method}
The data_set
function sets a value within a nested array or object using "dot" notation:
$data = ['products' => ['desk' => ['price' => 100]]];
data_set($data, 'products.desk.price', 200);
// ['products' => ['desk' => ['price' => 200]]]
This function also accepts wildcards using asterisks and will set values on the target accordingly:
$data = [
'products' => [
['name' => 'Desk 1', 'price' => 100],
['name' => 'Desk 2', 'price' => 150],
],
];
data_set($data, 'products.*.price', 200);
/*
[
'products' => [
['name' => 'Desk 1', 'price' => 200],
['name' => 'Desk 2', 'price' => 200],
],
]
*/
By default, any existing values are overwritten. If you wish to only set a value if it doesn't exist, you may pass false
as the fourth argument to the function:
$data = ['products' => ['desk' => ['price' => 100]]];
data_set($data, 'products.desk.price', 200, $overwrite = false);
// ['products' => ['desk' => ['price' => 100]]]
head()
{#collection-method}
The head
function returns the first element in the given array:
$array = [100, 200, 300];
$first = head($array);
// 100
last()
{#collection-method}
The last
function returns the last element in the given array:
$array = [100, 200, 300];
$last = last($array);
// 300
Paths
app_path()
{#collection-method}
The app_path
function returns the fully qualified path to your application's app
directory. You may also use the app_path
function to generate a fully qualified path to a file relative to the application directory:
$path = app_path();
$path = app_path('Http/Controllers/Controller.php');
base_path()
{#collection-method}
The base_path
function returns the fully qualified path to your application's root directory. You may also use the base_path
function to generate a fully qualified path to a given file relative to the project root directory:
$path = base_path();
$path = base_path('vendor/bin');
config_path()
{#collection-method}
The config_path
function returns the fully qualified path to your application's config
directory. You may also use the config_path
function to generate a fully qualified path to a given file within the application's configuration directory:
$path = config_path();
$path = config_path('app.php');
database_path()
{#collection-method}
The database_path
function returns the fully qualified path to your application's database
directory. You may also use the database_path
function to generate a fully qualified path to a given file within the database directory:
$path = database_path();
$path = database_path('factories/UserFactory.php');
mix()
{#collection-method}
The mix
function returns the path to a versioned Mix file:
$path = mix('css/app.css');
public_path()
{#collection-method}
The public_path
function returns the fully qualified path to your application's public
directory. You may also use the public_path
function to generate a fully qualified path to a given file within the public directory:
$path = public_path();
$path = public_path('css/app.css');
resource_path()
{#collection-method}
The resource_path
function returns the fully qualified path to your application's resources
directory. You may also use the resource_path
function to generate a fully qualified path to a given file within the resources directory:
$path = resource_path();
$path = resource_path('sass/app.scss');
storage_path()
{#collection-method}
The storage_path
function returns the fully qualified path to your application's storage
directory. You may also use the storage_path
function to generate a fully qualified path to a given file within the storage directory:
$path = storage_path();
$path = storage_path('app/file.txt');
Strings
__()
{#collection-method}
The __
function translates the given translation string or translation key using your localization files:
echo __('Welcome to our application');
echo __('messages.welcome');
If the specified translation string or key does not exist, the __
function will return the given value. So, using the example above, the __
function would return messages.welcome
if that translation key does not exist.
class_basename()
{#collection-method}
The class_basename
function returns the class name of the given class with the class's namespace removed:
$class = class_basename('Foo\Bar\Baz');
// Baz
e()
{#collection-method}
The e
function runs PHP's htmlspecialchars
function with the double_encode
option set to true
by default:
echo e('foo');
// foo
preg_replace_array()
{#collection-method}
The preg_replace_array
function replaces a given pattern in the string sequentially using an array:
$string = 'The event will take place between :start and :end';
$replaced = preg_replace_array('/:[a-z_]+/', ['8:30', '9:00'], $string);
// The event will take place between 8:30 and 9:00
Str::after()
{#collection-method}
The Str::after
method returns everything after the given value in a string. The entire string will be returned if the value does not exist within the string:
use Illuminate\Support\Str;
$slice = Str::after('This is my name', 'This is');
// ' my name'
Str::afterLast()
{#collection-method}
The Str::afterLast
method returns everything after the last occurrence of the given value in a string. The entire string will be returned if the value does not exist within the string:
use Illuminate\Support\Str;
$slice = Str::afterLast('App\Http\Controllers\Controller', '\\');
// 'Controller'
Str::ascii()
{#collection-method}
The Str::ascii
method will attempt to transliterate the string into an ASCII value:
use Illuminate\Support\Str;
$slice = Str::ascii('û');
// 'u'
Str::before()
{#collection-method}
The Str::before
method returns everything before the given value in a string:
use Illuminate\Support\Str;
$slice = Str::before('This is my name', 'my name');
// 'This is '
Str::beforeLast()
{#collection-method}
The Str::beforeLast
method returns everything before the last occurrence of the given value in a string:
use Illuminate\Support\Str;
$slice = Str::beforeLast('This is my name', 'is');
// 'This '
Str::between()
{#collection-method}
The Str::between
method returns the portion of a string between two values:
use Illuminate\Support\Str;
$slice = Str::between('This is my name', 'This', 'name');
// ' is my '
Str::camel()
{#collection-method}
The Str::camel
method converts the given string to camelCase
:
use Illuminate\Support\Str;
$converted = Str::camel('foo_bar');
// fooBar
Str::contains()
{#collection-method}
The Str::contains
method determines if the given string contains the given value. This method is case sensitive:
use Illuminate\Support\Str;
$contains = Str::contains('This is my name', 'my');
// true
You may also pass an array of values to determine if the given string contains any of the values in the array:
use Illuminate\Support\Str;
$contains = Str::contains('This is my name', ['my', 'foo']);
// true
Str::containsAll()
{#collection-method}
The Str::containsAll
method determines if the given string contains all of the values in a given array:
use Illuminate\Support\Str;
$containsAll = Str::containsAll('This is my name', ['my', 'name']);
// true
Str::endsWith()
{#collection-method}
The Str::endsWith
method determines if the given string ends with the given value:
use Illuminate\Support\Str;
$result = Str::endsWith('This is my name', 'name');
// true
You may also pass an array of values to determine if the given string ends with any of the values in the array:
use Illuminate\Support\Str;
$result = Str::endsWith('This is my name', ['name', 'foo']);
// true
$result = Str::endsWith('This is my name', ['this', 'foo']);
// false
Str::finish()
{#collection-method}
The Str::finish
method adds a single instance of the given value to a string if it does not already end with that value:
use Illuminate\Support\Str;
$adjusted = Str::finish('this/string', '/');
// this/string/
$adjusted = Str::finish('this/string/', '/');
// this/string/
Str::is()
{#collection-method}
The Str::is
method determines if a given string matches a given pattern. Asterisks may be used as wildcard values:
use Illuminate\Support\Str;
$matches = Str::is('foo*', 'foobar');
// true
$matches = Str::is('baz*', 'foobar');
// false
Str::isAscii()
{#collection-method}
The Str::isAscii
method determines if a given string is 7 bit ASCII:
use Illuminate\Support\Str;
$isAscii = Str::isAscii('Taylor');
// true
$isAscii = Str::isAscii('ü');
// false
Str::isUuid()
{#collection-method}
The Str::isUuid
method determines if the given string is a valid UUID:
use Illuminate\Support\Str;
$isUuid = Str::isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de');
// true
$isUuid = Str::isUuid('laravel');
// false
Str::kebab()
{#collection-method}
The Str::kebab
method converts the given string to kebab-case
:
use Illuminate\Support\Str;
$converted = Str::kebab('fooBar');
// foo-bar
Str::length()
{#collection-method}
The Str::length
method returns the length of the given string:
use Illuminate\Support\Str;
$length = Str::length('Laravel');
// 7
Str::limit()
{#collection-method}
The Str::limit
method truncates the given string to the specified length:
use Illuminate\Support\Str;
$truncated = Str::limit('The quick brown fox jumps over the lazy dog', 20);
// The quick brown fox...
You may pass a third argument to the method to change the string that will be appended to the end of the truncated string:
use Illuminate\Support\Str;
$truncated = Str::limit('The quick brown fox jumps over the lazy dog', 20, ' (...)');
// The quick brown fox (...)
Str::lower()
{#collection-method}
The Str::lower
method converts the given string to lowercase:
use Illuminate\Support\Str;
$converted = Str::lower('LARAVEL');
// laravel
Str::markdown()
{#collection-method}
The Str::markdown
method converts GitHub flavored Markdown into HTML:
use Illuminate\Support\Str;
$html = Str::markdown('# Laravel');
//
Laravel

$html = Str::markdown('# Taylor Otwell', [
'html_input' => 'strip',
]);
//
Taylor Otwell

Str::orderedUuid()
{#collection-method}
The Str::orderedUuid
method generates a "timestamp first" UUID that may be efficiently stored in an indexed database column. Each UUID that is generated using this method will be sorted after UUIDs previously generated using the method:
use Illuminate\Support\Str;
return (string) Str::orderedUuid();
Str::padBoth()
{#collection-method}
The Str::padBoth
method wraps PHP's str_pad
function, padding both sides of a string with another string until the final string reaches a desired length:
use Illuminate\Support\Str;
$padded = Str::padBoth('James', 10, '_');
// '__James___'
$padded = Str::padBoth('James', 10);
// ' James '
Str::padLeft()
{#collection-method}
The Str::padLeft
method wraps PHP's str_pad
function, padding the left side of a string with another string until the final string reaches a desired length:
use Illuminate\Support\Str;
$padded = Str::padLeft('James', 10, '-=');
// '-=-=-James'
$padded = Str::padLeft('James', 10);
// ' James'
Str::padRight()
{#collection-method}
The Str::padRight
method wraps PHP's str_pad
function, padding the right side of a string with another string until the final string reaches a desired length:
use Illuminate\Support\Str;
$padded = Str::padRight('James', 10, '-');
// 'James-----'
$padded = Str::padRight('James', 10);
// 'James '
Str::plural()
{#collection-method}
The Str::plural
method converts a singular word string to its plural form. This function currently only supports the English language:
use Illuminate\Support\Str;
$plural = Str::plural('car');
// cars
$plural = Str::plural('child');
// children
You may provide an integer as a second argument to the function to retrieve the singular or plural form of the string:
use Illuminate\Support\Str;
$plural = Str::plural('child', 2);
// children
$singular = Str::plural('child', 1);
// child
Str::pluralStudly()
{#collection-method}
The Str::pluralStudly
method converts a singular word string formatted in studly caps case to its plural form. This function currently only supports the English language:
use Illuminate\Support\Str;
$plural = Str::pluralStudly('VerifiedHuman');
// VerifiedHumans
$plural = Str::pluralStudly('UserFeedback');
// UserFeedback
You may provide an integer as a second argument to the function to retrieve the singular or plural form of the string:
use Illuminate\Support\Str;
$plural = Str::pluralStudly('VerifiedHuman', 2);
// VerifiedHumans
$singular = Str::pluralStudly('VerifiedHuman', 1);
// VerifiedHuman
Str::random()
{#collection-method}
The Str::random
method generates a random string of the specified length. This function uses PHP's random_bytes
function:
use Illuminate\Support\Str;
$random = Str::random(40);
Str::remove()
{#collection-method}
The Str::remove
method removes the given value or array of values from the string:
use Illuminate\Support\Str;
$string = 'Peter Piper picked a peck of pickled peppers.';
$removed = Str::remove('e', $string);
// Ptr Pipr pickd a pck of pickld ppprs.
You may also pass false
as a third argument to the remove
method to ignore case when removing strings.
Str::replace()
{#collection-method}
The Str::replace
method replaces a given string within the string:
use Illuminate\Support\Str;
$string = 'Laravel 8.x';
$replaced = Str::replace('8.x', '9.x', $string);
// Laravel 9.x
Str::replaceArray()
{#collection-method}
The Str::replaceArray
method replaces a given value in the string sequentially using an array:
use Illuminate\Support\Str;
$string = 'The event will take place between ? and ?';
$replaced = Str::replaceArray('?', ['8:30', '9:00'], $string);
// The event will take place between 8:30 and 9:00
Str::replaceFirst()
{#collection-method}
The Str::replaceFirst
method replaces the first occurrence of a given value in a string:
use Illuminate\Support\Str;
$replaced = Str::replaceFirst('the', 'a', 'the quick brown fox jumps over the lazy dog');
// a quick brown fox jumps over the lazy dog
Str::replaceLast()
{#collection-method}
The Str::replaceLast
method replaces the last occurrence of a given value in a string:
use Illuminate\Support\Str;
$replaced = Str::replaceLast('the', 'a', 'the quick brown fox jumps over the lazy dog');
// the quick brown fox jumps over a lazy dog
Str::singular()
{#collection-method}
The Str::singular
method converts a string to its singular form. This function currently only supports the English language:
use Illuminate\Support\Str;
$singular = Str::singular('cars');
// car
$singular = Str::singular('children');
// child
Str::slug()
{#collection-method}
The Str::slug
method generates a URL friendly "slug" from the given string:
use Illuminate\Support\Str;
$slug = Str::slug('Laravel 5 Framework', '-');
// laravel-5-framework
Str::snake()
{#collection-method}
The Str::snake
method converts the given string to snake_case
:
use Illuminate\Support\Str;
$converted = Str::snake('fooBar');
// foo_bar
Str::start()
{#collection-method}
The Str::start
method adds a single instance of the given value to a string if it does not already start with that value:
use Illuminate\Support\Str;
$adjusted = Str::start('this/string', '/');
// /this/string
$adjusted = Str::start('/this/string', '/');
// /this/string
Str::startsWith()
{#collection-method}
The Str::startsWith
method determines if the given string begins with the given value:
use Illuminate\Support\Str;
$result = Str::startsWith('This is my name', 'This');
// true
If an array of possible values is passed, the startsWith
method will return true
if the string begins with any of the given values:
$result = Str::startsWith('This is my name', ['This', 'That', 'There']);
// true
Str::studly()
{#collection-method}
The Str::studly
method converts the given string to StudlyCase
:
use Illuminate\Support\Str;
$converted = Str::studly('foo_bar');
// FooBar
Str::substr()
{#collection-method}
The Str::substr
method returns the portion of string specified by the start and length parameters:
use Illuminate\Support\Str;
$converted = Str::substr('The Laravel Framework', 4, 7);
// Laravel
Str::substrCount()
{#collection-method}
The Str::substrCount
method returns the number of occurrences of a given value in the given string:
use Illuminate\Support\Str;
$count = Str::substrCount('If you like ice cream, you will like snow cones.', 'like');
// 2
Str::title()
{#collection-method}
The Str::title
method converts the given string to Title Case
:
use Illuminate\Support\Str;
$converted = Str::title('a nice title uses the correct case');
// A Nice Title Uses The Correct Case
Str::ucfirst()
{#collection-method}
The Str::ucfirst
method returns the given string with the first character capitalized:
use Illuminate\Support\Str;
$string = Str::ucfirst('foo bar');
// Foo bar
Str::upper()
{#collection-method}
The Str::upper
method converts the given string to uppercase:
use Illuminate\Support\Str;
$string = Str::upper('laravel');
// LARAVEL
Str::uuid()
{#collection-method}
The Str::uuid
method generates a UUID (version 4):
use Illuminate\Support\Str;
return (string) Str::uuid();
wordCount
The wordCount
function returns the number of words that a string contains:
use Illuminate\Support\Str;
Str::wordCount('Hello, world!'); // 2
Str::words()
{#collection-method}
The Str::words
method limits the number of words in a string. An additional string may be passed to this method via its third argument to specify which string should be appended to the end of the truncated string:
use Illuminate\Support\Str;
return Str::words('Perfectly balanced, as all things should be.', 3, ' >>>');
// Perfectly balanced, as >>>
trans()
{#collection-method}
The trans
function translates the given translation key using your localization files:
echo trans('messages.welcome');
If the specified translation key does not exist, the trans
function will return the given key. So, using the example above, the trans
function would return messages.welcome
if the translation key does not exist.
trans_choice()
{#collection-method}
The trans_choice
function translates the given translation key with inflection:
echo trans_choice('messages.notifications', $unreadCount);
If the specified translation key does not exist, the trans_choice
function will return the given key. So, using the example above, the trans_choice
function would return messages.notifications
if the translation key does not exist.
Fluent Strings
Fluent strings provide a more fluent, object-oriented interface for working with string values, allowing you to chain multiple string operations together using a more readable syntax compared to traditional string operations.
after
{#collection-method}
The after
method returns everything after the given value in a string. The entire string will be returned if the value does not exist within the string:
use Illuminate\Support\Str;
$slice = Str::of('This is my name')->after('This is');
// ' my name'
afterLast
{#collection-method}
The afterLast
method returns everything after the last occurrence of the given value in a string. The entire string will be returned if the value does not exist within the string:
use Illuminate\Support\Str;
$slice = Str::of('App\Http\Controllers\Controller')->afterLast('\\');
// 'Controller'
append
{#collection-method}
The append
method appends the given values to the string:
use Illuminate\Support\Str;
$string = Str::of('Taylor')->append(' Otwell');
// 'Taylor Otwell'
ascii
{#collection-method}
The ascii
method will attempt to transliterate the string into an ASCII value:
use Illuminate\Support\Str;
$string = Str::of('ü')->ascii();
// 'u'
basename
{#collection-method}
The basename
method will return the trailing name component of the given string:
use Illuminate\Support\Str;
$string = Str::of('/foo/bar/baz')->basename();
// 'baz'
If needed, you may provide an "extension" that will be removed from the trailing component:
use Illuminate\Support\Str;
$string = Str::of('/foo/bar/baz.jpg')->basename('.jpg');
// 'baz'
before
{#collection-method}
The before
method returns everything before the given value in a string:
use Illuminate\Support\Str;
$slice = Str::of('This is my name')->before('my name');
// 'This is '
beforeLast
{#collection-method}
The beforeLast
method returns everything before the last occurrence of the given value in a string:
use Illuminate\Support\Str;
$slice = Str::of('This is my name')->beforeLast('is');
// 'This '
camel
{#collection-method}
The camel
method converts the given string to camelCase
:
use Illuminate\Support\Str;
$converted = Str::of('foo_bar')->camel();
// fooBar
contains
{#collection-method}
The contains
method determines if the given string contains the given value. This method is case sensitive:
use Illuminate\Support\Str;
$contains = Str::of('This is my name')->contains('my');
// true
You may also pass an array of values to determine if the given string contains any of the values in the array:
use Illuminate\Support\Str;
$contains = Str::of('This is my name')->contains(['my', 'foo']);
// true
containsAll
{#collection-method}
The containsAll
method determines if the given string contains all of the values in the given array:
use Illuminate\Support\Str;
$containsAll = Str::of('This is my name')->containsAll(['my', 'name']);
// true
dirname
{#collection-method}
The dirname
method returns the parent directory portion of the given string:
use Illuminate\Support\Str;
$string = Str::of('/foo/bar/baz')->dirname();
// '/foo/bar'
If necessary, you may specify how many directory levels you wish to trim from the string:
use Illuminate\Support\Str;
$string = Str::of('/foo/bar/baz')->dirname(2);
// '/foo'
endsWith
{#collection-method}
The endsWith
method determines if the given string ends with the given value:
use Illuminate\Support\Str;
$result = Str::of('This is my name')->endsWith('name');
// true
You may also pass an array of values to determine if the given string ends with any of the values in the array:
use Illuminate\Support\Str;
$result = Str::of('This is my name')->endsWith(['name', 'foo']);
// true
$result = Str::of('This is my name')->endsWith(['this', 'foo']);
// false
exactly
{#collection-method}
The exactly
method determines if the given string is an exact match with another string:
use Illuminate\Support\Str;
$result = Str::of('Laravel')->exactly('Laravel');
// true
explode
{#collection-method}
The explode
method splits the string by the given delimiter and returns a collection containing each section of the split string:
use Illuminate\Support\Str;
$collection = Str::of('foo bar baz')->explode(' ');
// collect(['foo', 'bar', 'baz'])
finish
{#collection-method}
The finish
method adds a single instance of the given value to a string if it does not already end with that value:
use Illuminate\Support\Str;
$adjusted = Str::of('this/string')->finish('/');
// this/string/
$adjusted = Str::of('this/string/')->finish('/');
// this/string/
is
{#collection-method}
The is
method determines if a given string matches a given pattern. Asterisks may be used as wildcard values
use Illuminate\Support\Str;
$matches = Str::of('foobar')->is('foo*');
// true
$matches = Str::of('foobar')->is('baz*');
// false
isAscii
{#collection-method}
The isAscii
method determines if a given string is an ASCII string:
use Illuminate\Support\Str;
$result = Str::of('Taylor')->isAscii();
// true
$result = Str::of('ü')->isAscii();
// false
isEmpty
{#collection-method}
The isEmpty
method determines if the given string is empty:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isEmpty();
// true
$result = Str::of('Laravel')->trim()->isEmpty();
// false
isNotEmpty
{#collection-method}
The isNotEmpty
method determines if the given string is not empty:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isNotEmpty();
// false
$result = Str::of('Laravel')->trim()->isNotEmpty();
// true
kebab
{#collection-method}
The kebab
method converts the given string to kebab-case
:
use Illuminate\Support\Str;
$converted = Str::of('fooBar')->kebab();
// foo-bar
length
{#collection-method}
The length
method returns the length of the given string:
use Illuminate\Support\Str;
$length = Str::of('Laravel')->length();
// 7
limit
{#collection-method}
The limit
method truncates the given string to the specified length:
use Illuminate\Support\Str;
$truncated = Str::of('The quick brown fox jumps over the lazy dog')->limit(20);
// The quick brown fox...
You may also pass a second argument to change the string that will be appended to the end of the truncated string:
use Illuminate\Support\Str;
$truncated = Str::of('The quick brown fox jumps over the lazy dog')->limit(20, ' (...)');
// The quick brown fox (...)
lower
{#collection-method}
The lower
method converts the given string to lowercase:
use Illuminate\Support\Str;
$result = Str::of('LARAVEL')->lower();
// 'laravel'
ltrim
{#collection-method}
The ltrim
method trims the left side of the string:
use Illuminate\Support\Str;
$string = Str::of(' Laravel ')->ltrim();
// 'Laravel '
$string = Str::of('/Laravel/')->ltrim('/');
// 'Laravel/'
markdown
{#collection-method}
The markdown
method converts GitHub flavored Markdown into HTML:
use Illuminate\Support\Str;
$html = Str::of('# Laravel')->markdown();
//
Laravel

$html = Str::of('# Taylor Otwell')->markdown([
'html_input' => 'strip',
]);
//
Taylor Otwell

match
{#collection-method}
The match
method will return the portion of a string that matches a given regular expression pattern:
use Illuminate\Support\Str;
$result = Str::of('foo bar')->match('/bar/');
// 'bar'
$result = Str::of('foo bar')->match('/foo (.*)/');
// 'bar'
matchAll
{#collection-method}
The matchAll
method will return a collection containing the portions of a string that match a given regular expression pattern:
use Illuminate\Support\Str;
$result = Str::of('bar foo bar')->matchAll('/bar/');
// collect(['bar', 'bar'])
If you specify a matching group within the expression, Laravel will return a collection of that group's matches:
use Illuminate\Support\Str;
$result = Str::of('bar fun bar fly')->matchAll('/f(\w*)/');
// collect(['un', 'ly']);
If no matches are found, an empty collection will be returned.
padBoth
{#collection-method}
The padBoth
method wraps PHP's str_pad
function, padding both sides of a string with another string until the final string reaches the desired length:
use Illuminate\Support\Str;
$padded = Str::of('James')->padBoth(10, '_');
// '__James___'
$padded = Str::of('James')->padBoth(10);
// ' James '
padLeft
{#collection-method}
The padLeft
method wraps PHP's str_pad
function, padding the left side of a string with another string until the final string reaches the desired length:
use Illuminate\Support\Str;
$padded = Str::of('James')->padLeft(10, '-=');
// '-=-=-James'
$padded = Str::of('James')->padLeft(10);
// ' James'
padRight
{#collection-method}
The padRight
method wraps PHP's str_pad
function, padding the right side of a string with another string until the final string reaches the desired length:
use Illuminate\Support\Str;
$padded = Str::of('James')->padRight(10, '-');
// 'James-----'
$padded = Str::of('James')->padRight(10);
// 'James '
pipe
{#collection-method}
The pipe
method allows you to transform the string by passing its current value to the given callable:
use Illuminate\Support\Str;
$hash = Str::of('Laravel')->pipe('md5')->prepend('Checksum: ');
// 'Checksum: a5c95b86291ea299fcbe64458ed12702'
$closure = Str::of('foo')->pipe(function ($str) {
return 'bar';
});
// 'bar'
plural
{#collection-method}
The plural
method converts a singular word string to its plural form. This function currently only supports the English language:
use Illuminate\Support\Str;
$plural = Str::of('car')->plural();
// cars
$plural = Str::of('child')->plural();
// children
You may provide an integer as a second argument to the function to retrieve the singular or plural form of the string:
use Illuminate\Support\Str;
$plural = Str::of('child')->plural(2);
// children
$plural = Str::of('child')->plural(1);
// child
prepend
{#collection-method}
The prepend
method prepends the given values onto the string:
use Illuminate\Support\Str;
$string = Str::of('Framework')->prepend('Laravel ');
// Laravel Framework
remove
{#collection-method}
The remove
method removes the given value or array of values from the string:
use Illuminate\Support\Str;
$string = Str::of('Arkansas is quite beautiful!')->remove('quite');
// Arkansas is beautiful!
You may also pass false
as a second parameter to ignore case when removing.
replace
{#collection-method}
The replace
method replaces a given string within the string:
use Illuminate\Support\Str;
$replaced = Str::of('Laravel 6.x')->replace('6.x', '7.x');
// Laravel 7.x
replaceArray
{#collection-method}
The replaceArray
method replaces a given value in the string sequentially using an array:
use Illuminate\Support\Str;
$string = 'The event will take place between ? and ?';
$replaced = Str::of($string)->replaceArray('?', ['8:30', '9:00']);
// The event will take place between 8:30 and 9:00
replaceFirst
{#collection-method}
The replaceFirst
method replaces the first occurrence of a given value in a string:
use Illuminate\Support\Str;
$replaced = Str::of('the quick brown fox jumps over the lazy dog')->replaceFirst('the', 'a');
// a quick brown fox jumps over the lazy dog
replaceLast
{#collection-method}
The replaceLast
method replaces the last occurrence of a given value in a string:
use Illuminate\Support\Str;
$replaced = Str::of('the quick brown fox jumps over the lazy dog')->replaceLast('the', 'a');
// the quick brown fox jumps over a lazy dog
replaceMatches
{#collection-method}
The replaceMatches
method replaces all portions of a string matching a pattern with the given replacement string:
use Illuminate\Support\Str;
$replaced = Str::of('(+1)<PHONE_NUMBER>')->replaceMatches('/[^A-Za-z0-9]++/', '')
// '15015551000'
The replaceMatches
method also accepts a closure that will be invoked with each portion of the string matching the given pattern, allowing you to perform the replacement logic within the closure and return the replaced value:
use Illuminate\Support\Str;
$replaced = Str::of('123')->replaceMatches('/\d/', function ($match) {
return '['.$match[0].']';
});
// '[1][2][3]'
rtrim
{#collection-method}
The rtrim
method trims the right side of the given string:
use Illuminate\Support\Str;
$string = Str::of(' Laravel ')->rtrim();
// ' Laravel'
$string = Str::of('/Laravel/')->rtrim('/');
// '/Laravel'
singular
{#collection-method}
The singular
method converts a string to its singular form. This function currently only supports the English language:
use Illuminate\Support\Str;
$singular = Str::of('cars')->singular();
// car
$singular = Str::of('children')->singular();
// child
slug
{#collection-method}
The slug
method generates a URL friendly "slug" from the given string:
use Illuminate\Support\Str;
$slug = Str::of('Laravel Framework')->slug('-');
// laravel-framework
snake
{#collection-method}
The snake
method converts the given string to snake_case
:
use Illuminate\Support\Str;
$converted = Str::of('fooBar')->snake();
// foo_bar
split
{#collection-method}
The split
method splits a string into a collection using a regular expression:
use Illuminate\Support\Str;
$segments = Str::of('one, two, three')->split('/[\s,]+/');
// collect(["one", "two", "three"])
start
{#collection-method}
The start
method adds a single instance of the given value to a string if it does not already start with that value:
use Illuminate\Support\Str;
$adjusted = Str::of('this/string')->start('/');
// /this/string
$adjusted = Str::of('/this/string')->start('/');
// /this/string
startsWith
{#collection-method}
The startsWith
method determines if the given string begins with the given value:
use Illuminate\Support\Str;
$result = Str::of('This is my name')->startsWith('This');
// true
studly
{#collection-method}
The studly
method converts the given string to StudlyCase
:
use Illuminate\Support\Str;
$converted = Str::of('foo_bar')->studly();
// FooBar
substr
{#collection-method}
The substr
method returns the portion of the string specified by the given start and length parameters:
use Illuminate\Support\Str;
$string = Str::of('Laravel Framework')->substr(8);
// Framework
$string = Str::of('Laravel Framework')->substr(8, 5);
// Frame
tap
{#collection-method}
The tap
method passes the string to the given closure, allowing you to examine and interact with the string while not affecting the string itself. The original string is returned by the tap
method regardless of what is returned by the closure:
use Illuminate\Support\Str;
$string = Str::of('Laravel')
->append(' Framework')
->tap(function ($string) {
dump('String after append: ' . $string);
})
->upper();
// LARAVEL FRAMEWORK
test
{#collection-method}
The test
method determines if a string matches the given regular expression pattern:
use Illuminate\Support\Str;
$result = Str::of('Laravel Framework')->test('/Laravel/');
// true
title
{#collection-method}
The title
method converts the given string to Title Case
:
use Illuminate\Support\Str;
$converted = Str::of('a nice title uses the correct case')->title();
// A Nice Title Uses The Correct Case
trim
{#collection-method}
The trim
method trims the given string:
use Illuminate\Support\Str;
$string = Str::of(' Laravel ')->trim();
// 'Laravel'
$string = Str::of('/Laravel/')->trim('/');
// 'Laravel'
ucfirst
{#collection-method}
The ucfirst
method returns the given string with the first character capitalized:
use Illuminate\Support\Str;
$string = Str::of('foo bar')->ucfirst();
// Foo bar
upper
{#collection-method}
The upper
method converts the given string to uppercase:
use Illuminate\Support\Str;
$adjusted = Str::of('laravel')->upper();
// LARAVEL
when
{#collection-method}
The when
method invokes the given closure if a given condition is true
. The closure will receive the fluent string instance:
use Illuminate\Support\Str;
$string = Str::of('Taylor')
->when(true, function ($string) {
return $string->append(' Otwell');
});
// 'Taylor Otwell'
If necessary, you may pass another closure as the third parameter to the when
method. This closure will execute if the condition parameter evaluates to false
.
whenEmpty
{#collection-method}
The whenEmpty
method invokes the given closure if the string is empty. If the closure returns a value, that value will also be returned by the whenEmpty
method. If the closure does not return a value, the fluent string instance will be returned:
use Illuminate\Support\Str;
$string = Str::of(' ')->whenEmpty(function ($string) {
return $string->trim()->prepend('Laravel');
});
// 'Laravel'
wordCount
The wordCount
function returns the number of words that a string contains:
use Illuminate\Support\Str;
Str::of('Hello, world!')->wordCount(); // 2
words
{#collection-method}
The words
method limits the number of words in a string. If necessary, you may specify an additional string that will be appended to the truncated string:
use Illuminate\Support\Str;
$string = Str::of('Perfectly balanced, as all things should be.')->words(3, ' >>>');
// Perfectly balanced, as >>>
URLs
action()
{#collection-method}
The action
function generates a URL for the given controller action:
use App\Http\Controllers\HomeController;
$url = action([HomeController::class, 'index']);
If the method accepts route parameters, you may pass them as the second argument to the method:
$url = action([UserController::class, 'profile'], ['id' => 1]);
asset()
{#collection-method}
The asset
function generates a URL for an asset using the current scheme of the request (HTTP or HTTPS):
$url = asset('img/photo.jpg');
You can configure the asset URL host by setting the ASSET_URL
variable in your .env
file. This can be useful if you host your assets on an external service like Amazon S3 or another CDN:
// ASSET_URL=http://example.com/assets
$url = asset('img/photo.jpg'); // http://example.com/assets/img/photo.jpg
route()
{#collection-method}
The route
function generates a URL for a given named route:
$url = route('route.name');
If the route accepts parameters, you may pass them as the second argument to the function:
$url = route('route.name', ['id' => 1]);
By default, the route
function generates an absolute URL. If you wish to generate a relative URL, you may pass false
as the third argument to the function:
$url = route('route.name', ['id' => 1], false);
secure_asset()
{#collection-method}
The secure_asset
function generates a URL for an asset using HTTPS:
$url = secure_asset('img/photo.jpg');
secure_url()
{#collection-method}
The secure_url
function generates a fully qualified HTTPS URL to the given path. Additional URL segments may be passed in the function's second argument:
$url = secure_url('user/profile');
$url = secure_url('user/profile', [1]);
url()
{#collection-method}
The url
function generates a fully qualified URL to the given path:
$url = url('user/profile');
$url = url('user/profile', [1]);
If no path is provided, an Illuminate\Routing\UrlGenerator
instance is returned:
$current = url()->current();
$full = url()->full();
$previous = url()->previous();
Miscellaneous
abort()
{#collection-method}
The abort
function throws an HTTP exception which will be rendered by the exception handler:
abort(403);
You may also provide the exception's message and custom HTTP response headers that should be sent to the browser:
abort(403, 'Unauthorized.', $headers);
abort_if()
{#collection-method}
The abort_if
function throws an HTTP exception if a given boolean expression evaluates to true
:
abort_if(! Auth::user()->isAdmin(), 403);
Like the abort
method, you may also provide the exception's response text as the third argument and an array of custom response headers as the fourth argument to the function.
abort_unless()
{#collection-method}
The abort_unless
function throws an HTTP exception if a given boolean expression evaluates to false
:
abort_unless(Auth::user()->isAdmin(), 403);
Like the abort
method, you may also provide the exception's response text as the third argument and an array of custom response headers as the fourth argument to the function.
app()
{#collection-method}
The app
function returns the service container instance:
$container = app();
You may pass a class or interface name to resolve it from the container:
$api = app('HelpSpot\API');
auth()
{#collection-method}
The auth
function returns an authenticator instance. You may use it as an alternative to the Auth
facade:
$user = auth()->user();
If needed, you may specify which guard instance you would like to access:
$user = auth('admin')->user();
back()
{#collection-method}
The back
function generates a redirect HTTP response to the user's previous location:
return back($status = 302, $headers = [], $fallback = '/');
return back();
bcrypt()
{#collection-method}
The bcrypt
function hashes the given value using Bcrypt. You may use this function as an alternative to the Hash
facade:
$password = bcrypt('my-secret-password');
blank()
{#collection-method}
The blank
function determines whether the given value is "blank":
blank('');
blank(' ');
blank(null);
blank(collect());
// true
blank(0);
blank(true);
blank(false);
// false
For the inverse of blank
, see the filled
method.
broadcast()
{#collection-method}
The broadcast
function broadcasts the given event to its listeners:
broadcast(new UserRegistered($user));
broadcast(new UserRegistered($user))->toOthers();
cache()
{#collection-method}
The cache
function may be used to get values from the cache. If the given key does not exist in the cache, an optional default value will be returned:
$value = cache('key');
$value = cache('key', 'default');
You may add items to the cache by passing an array of key / value pairs to the function. You should also pass the number of seconds or duration the cached value should be considered valid:
cache(['key' => 'value'], 300);
cache(['key' => 'value'], now()->addSeconds(10));
class_uses_recursive()
{#collection-method}
The class_uses_recursive
function returns all traits used by a class, including traits used by all of its parent classes:
$traits = class_uses_recursive(App\Models\User::class);
collect()
{#collection-method}
The collect
function creates a collection instance from the given value:
$collection = collect(['taylor', 'abigail']);
config()
{#collection-method}
The config
function gets the value of a configuration variable. The configuration values may be accessed using "dot" syntax, which includes the name of the file and the option you wish to access. A default value may be specified and is returned if the configuration option does not exist:
$value = config('app.timezone');
$value = config('app.timezone', $default);
You may set configuration variables at runtime by passing an array of key / value pairs. However, note that this function only affects the configuration value for the current request and does not update your actual configuration values:
config(['app.debug' => true]);
cookie()
{#collection-method}
The cookie
function creates a new cookie instance:
$cookie = cookie('name', 'value', $minutes);
csrf_field()
{#collection-method}
The csrf_field
function generates an HTML hidden
input field containing the value of the CSRF token. For example, using Blade syntax:
{{ csrf_field() }}
csrf_token()
{#collection-method}
The csrf_token
function retrieves the value of the current CSRF token:
$token = csrf_token();
dd()
{#collection-method}
The dd
function dumps the given variables and ends execution of the script:
dd($value);
dd($value1, $value2, $value3, ...);
If you do not want to halt the execution of your script, use the dump
function instead.
dispatch()
{#collection-method}
The dispatch
function pushes the given job onto the Laravel job queue:
dispatch(new App\Jobs\SendEmails);
dump()
{#collection-method}
The dump
function dumps the given variables:
dump($value);
dump($value1, $value2, $value3, ...);
If you want to stop executing the script after dumping the variables, use the dd
function instead.
env()
{#collection-method}
The env
function retrieves the value of an environment variable or returns a default value:
$env = env('APP_ENV');
$env = env('APP_ENV', 'production');
{note} If you execute the
config:cache
command during your deployment process, you should be sure that you are only calling theenv
function from within your configuration files. Once the configuration has been cached, the.env
file will not be loaded and all calls to theenv
function will returnnull
.
event()
{#collection-method}
The event
function dispatches the given event to its listeners:
event(new UserRegistered($user));
filled()
{#collection-method}
The filled
function determines whether the given value is not "blank":
filled(0);
filled(true);
filled(false);
// true
filled('');
filled(' ');
filled(null);
filled(collect());
// false
For the inverse of filled
, see the blank
method.
info()
{#collection-method}
The info
function will write information to your application's log:
info('Some helpful information!');
An array of contextual data may also be passed to the function:
info('User login attempt failed.', ['id' => $user->id]);
logger()
{#collection-method}
The logger
function can be used to write a debug
level message to the log:
logger('Debug message');
An array of contextual data may also be passed to the function:
logger('User has logged in.', ['id' => $user->id]);
A logger instance will be returned if no value is passed to the function:
logger()->error('You are not allowed here.');
method_field()
{#collection-method}
The method_field
function generates an HTML hidden
input field containing the spoofed value of the form's HTTP verb. For example, using Blade syntax:
<form method="POST">
{{ method_field('DELETE') }}
</form>
now()
{#collection-method}
The now
function creates a new Illuminate\Support\Carbon
instance for the current time:
$now = now();
old()
{#collection-method}
The old
function retrieves an old input value flashed into the session:
$value = old('value');
$value = old('value', 'default');
optional()
{#collection-method}
The optional
function accepts any argument and allows you to access properties or call methods on that object. If the given object is null
, properties and methods will return null
instead of causing an error:
return optional($user->address)->street;
{!! old('name', optional($user)->name) !!}
The optional
function also accepts a closure as its second argument. The closure will be invoked if the value provided as the first argument is not null:
return optional(User::find($id), function ($user) {
return $user->name;
});
policy()
{#collection-method}
The policy
method retrieves a policy instance for a given class:
$policy = policy(App\Models\User::class);
redirect()
{#collection-method}
The redirect
function returns a redirect HTTP response, or returns the redirector instance if called with no arguments:
return redirect($to = null, $status = 302, $headers = [], $https = null);
return redirect('/home');
return redirect()->route('route.name');
report()
{#collection-method}
The report
function will report an exception using your exception handler:
report($e);
The report
function also accepts a string as an argument. When a string is given to the function, the function will create an exception with the given string as its message:
report('Something went wrong.');
request()
{#collection-method}
The request
function returns the current request instance or obtains an input field's value from the current request:
$request = request();
$value = request('key', $default);
rescue()
{#collection-method}
The rescue
function executes the given closure and catches any exceptions that occur during its execution. All exceptions that are caught will be sent to your exception handler; however, the request will continue processing:
return rescue(function () {
return $this->method();
});
You may also pass a second argument to the rescue
function. This argument will be the "default" value that should be returned if an exception occurs while executing the closure:
return rescue(function () {
return $this->method();
}, false);
return rescue(function () {
return $this->method();
}, function () {
return $this->failure();
});
resolve()
{#collection-method}
The resolve
function resolves a given class or interface name to an instance using the service container:
$api = resolve('HelpSpot\API');
response()
{#collection-method}
The response
function creates a response instance or obtains an instance of the response factory:
return response('Hello World', 200, $headers);
return response()->json(['foo' => 'bar'], 200, $headers);
retry()
{#collection-method}
The retry
function attempts to execute the given callback until the given maximum attempt threshold is met. If the callback does not throw an exception, its return value will be returned. If the callback throws an exception, it will automatically be retried. If the maximum attempt count is exceeded, the exception will be thrown:
return retry(5, function () {
// Attempt 5 times while resting 100ms in between attempts...
}, 100);
session()
{#collection-method}
The session
function may be used to get or set session values:
$value = session('key');
You may set values by passing an array of key / value pairs to the function:
session(['chairs' => 7, 'instruments' => 3]);
The session store will be returned if no value is passed to the function:
$value = session()->get('key');
session()->put('key', $value);
tap()
{#collection-method}
The tap
function accepts two arguments: an arbitrary $value
and a closure. The $value
will be passed to the closure and then be returned by the tap
function. The return value of the closure is irrelevant:
$user = tap(User::first(), function ($user) {
$user->name = 'taylor';
$user->save();
});
If no closure is passed to the tap
function, you may call any method on the given $value
. The return value of the method you call will always be $value
, regardless of what the method actually returns in its definition. For example, the Eloquent update
method typically returns an integer. However, we can force the method to return the model itself by chaining the update
method call through the tap
function:
$user = tap($user)->update([
'name' => $name,
'email' => $email,
]);
To add a tap
method to a class, you may add the Illuminate\Support\Traits\Tappable
trait to the class. The tap
method of this trait accepts a Closure as its only argument. The object instance itself will be passed to the Closure and then be returned by the tap
method:
return $user->tap(function ($user) {
//
});
throw_if()
{#collection-method}
The throw_if
function throws the given exception if a given boolean expression evaluates to true
:
throw_if(! Auth::user()->isAdmin(), AuthorizationException::class);
throw_if(
! Auth::user()->isAdmin(),
AuthorizationException::class,
'You are not allowed to access this page.'
);
throw_unless()
{#collection-method}
The throw_unless
function throws the given exception if a given boolean expression evaluates to false
:
throw_unless(Auth::user()->isAdmin(), AuthorizationException::class);
throw_unless(
Auth::user()->isAdmin(),
AuthorizationException::class,
'You are not allowed to access this page.'
);
today()
{#collection-method}
The today
function creates a new Illuminate\Support\Carbon
instance for the current date:
$today = today();
trait_uses_recursive()
{#collection-method}
The trait_uses_recursive
function returns all traits used by a trait:
$traits = trait_uses_recursive(\Illuminate\Notifications\Notifiable::class);
transform()
{#collection-method}
The transform
function executes a closure on a given value if the value is not blank and then returns the return value of the closure:
$callback = function ($value) {
return $value * 2;
};
$result = transform(5, $callback);
// 10
A default value or closure may be passed as the third argument to the function. This value will be returned if the given value is blank:
$result = transform(null, $callback, 'The value is blank');
// The value is blank
validator()
{#collection-method}
The validator
function creates a new validator instance with the given arguments. You may use it as an alternative to the Validator
facade:
$validator = validator($data, $rules, $messages);
value()
{#collection-method}
The value
function returns the value it is given. However, if you pass a closure to the function, the closure will be executed and its returned value will be returned:
$result = value(true);
// true
$result = value(function () {
return false;
});
// false
view()
{#collection-method}
The view
function retrieves a view instance:
return view('auth.login');
with()
{#collection-method}
The with
function returns the value it is given. If a closure is passed as the second argument to the function, the closure will be executed and its returned value will be returned:
$callback = function ($value) {
return (is_numeric($value)) ? $value * 2 : 0;
};
$result = with(5, $callback);
// 10
$result = with(null, $callback);
// 0
$result = with(5, null);
// 5


uuencode
uuencode is a utility designed to enable arbitrary binary files to be transmitted using text-only media such as email. it does this by encoding the files in such a way that the encoded file contains only printable characters. (important note: this file is the result of an afternoon's hacking by myself. i make no guarantees as to its completeness and accuracy. i have coded my own uuencode and uudecode programs which haven't let me down yet) the uuencode algorithm hinges around a 3-byte-to-4-byte (8-bit to 6-bit data) encoding to convert all data to printable characters. to perform this encoding read in 3 bytes from the file to be encoded whose binary representation is a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 and convert them into 4 bytes with values in the range 0-63 as follows: 0 0 a7a6a5a4a3a2 0 0 a1a0b7b6b5b4 0 0 b3b2b1b0c7c6 0 0 c5c4c3c2c1c0 then convert these bytes to printable characters by adding 0x20 (32). exception: if you end up with a zero byte it should be converted to 0x60 (back-quote '`') rather than 0x20 (space ' '). so if you read 3 bytes from the file as follows: 14 0f a8 (hex) i.e. 00010100 00001111 10101000 your 4 bytes output should be 25 60 5e 48 ("%`^h"). the intermediate 4 bytes in this case were 00000101 00000000 00111110 00101000 note that the zero byte has been translated to 0x60 instead of 0x20. the body of a uuencoded file therefore only contains the characters 0x21 '!' to 0x60 '`', which are all printable and capable of being transmitted by email. (note: this of course means that uuencoded files are slightly more than 33% longer than the originals. uuencoding text-only files is redundant and a silly thing to do. standard and sensible practice is to compress the files first using a standard compression utility and then to uuencode them). in addition, the start of the encoding is marked by the line "start <mode> <filename>", where <mode> consists of 3 octal digits which are the unix mode of the file, and <filename> is the original filename of the file encoded. the end of the encoding is marked by the line "end". the first character of each line contains the line length in bytes *in the original file*, encoded in the same way as an ordinary byte i.e. line length 0->0x60, all other lengths add 0x20 to convert to printable characters. line lengths vary from 0 to 45 (which encodes to 'm'; this is why lines in a uuencoded file all start with an m), which is a line length of 61 characters (including the length character) in the encoded file. this is a nice safe length to transmit via email. lines in the encoded file are always a multiple of 4 + 1 characters long; this sometimes means that 1 or 2 bytes are thrown away at the end of the decoding. (note: i can't see any reason why lines shouldn't be an arbitrary length, and don't know whether the proper definition disallows this. i've never seen a uuencoded file where any line apart from the last one wasn't 'm' followed by 60 characters, though) to decode, simply perform the inverse of the encoding algorithm. ===== sample code ===== i include here the c source code to a small uuencode and uudecode utility i coded myself. it isn't very sophisticated and probably not very complete, but it does its job, and is very useful for my pc where i don't have access to the standard unix stuff. it took me about half an hour to write, and another hour or so to iron out the obvious bugs. it works quite happily under dos (uuencoding needs practically no internal storage). it isn't a great masterpiece of software design and coding, but might be worth a look. feel free to do whatever you want to it, up to and including throwing it in the bin. ===== uuencode.c ===== /* * uuencode.c - * simple uuencode utility * jim cameron, 1997 */ #include "stdio.h" #include "stdlib.h" #define max_linelen 45 #define encode_byte(b) (((b) == 0) ? 0x60 : ((b) + 0x20)) typedef unsigned char byte; int main (int argc, char *argv []) { file *infile = null; file *outfile = null; int linelen; int linecnt; byte inbuf [max_linelen]; byte *inbytep; char outbuf [5]; if (argc != 3) { fprintf (stderr, "syntax: uuencode <infile> <outfile>\n"); exit (1); } /* try and open the input file (binary) */ infile = fopen (argv [1], "rb"); if (infile == null) { fprintf (stderr, "uuencode: couldn't open input file %s\n", argv [1]); exit (1); } /* try and open the output file (text) */ outfile = fopen (argv [2], "wt"); if (outfile == null) { fprintf (stderr, "uuencode: couldn't open output file %s\n", argv [2]); exit (1); } /* write the 'begin' line, giving it a mode of 0600 */ fprintf (outfile, "begin 600 %s\n", argv [1]); do { /* read a line from input file */ linelen = fread (inbuf, 1, max_linelen, infile); /* write the line length byte */ fputc (encode_byte (linelen), outfile); /* encode the line */ for (linecnt = linelen, inbytep = inbuf; linecnt > 0; linecnt -= 3, inbytep += 3) { /* encode 3 bytes from the input buffer */ outbuf [0] = encode_byte ((inbytep [0] & 0xfc) >> 2); outbuf [1] = encode_byte (((inbytep [0] & 0x03) << 4) + ((inbytep [1] & 0xf0) >> 4)); outbuf [2] = encode_byte (((inbytep [1] & 0x0f) << 2) + ((inbytep [2] & 0xc0) >> 6)); outbuf [3] = encode_byte (inbytep [2] & 0x3f); outbuf [4] = '\0'; /* write the 4 encoded bytes to the file */ fprintf (outfile, "%s", outbuf); } fprintf (outfile, "\n"); } while (linelen != 0); /* write the 'end' marker */ fprintf (outfile, "end\n"); /* tidy up and return */ fclose (infile); fclose (outfile); return 0; } ===== uudecode.c ===== /* * uudecode.c - * simple uudecode utility * jim cameron, 1997 */ #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* we all hate magic numbers! */ #define line_buf_size 256 /* decode a byte */ #define decode_byte(b) ((b == 0x60) ? 0 : b - 0x20) typedef unsigned char byte; int main (int argc, char *argv []) { file *infile = null; file *outfile = null; char linebuf [line_buf_size]; char *linep = null; char *tempcp = null; int linelen = 0; int linecnt = 0; char outfname [line_buf_size]; byte outbyte [3]; /* check that we have the right number of arguments */ if (argc != 2) { fprintf (stderr, "syntax: uudecode <filename>\n"); exit (1); } /* open the input file */ infile = fopen (argv [1], "rt"); if (infile == null) { fprintf (stderr, "uudecode: couldn't open file %s\n", argv [1]); exit (1); } /* uu-encoded files always have a 'begin' marker, so go and look for this */ for (;;) { /* read a line */ if (fgets (linebuf, line_buf_size, infile) == null) { fprintf (stderr, "uudecode: not a valid uu-encoded file\n"); exit (1); } /* see if it is the 'begin' marker */ if ((strncmp (linebuf, "begin", 5) == 0) && isspace (linebuf [5])) { break; } } /* if we have reached this point, we have found a begin marker */ linep = linebuf + 5; /* next comes the mode, which we ignore */ while (isspace (*linep)) { linep++; } if (*linep == '\0') { fprintf (stderr, "uudecode: not a valid uu-encoded file\n"); exit (1); } while (isdigit (*linep)) { linep++; } while (isspace (*linep)) { linep++; } if (*linep == '\0') { fprintf (stderr, "uudecode: not a valid uu-encoded file/n"); exit (1); } /* the rest of the begin line is the output file name */ strcpy (outfname, linep); tempcp = outfname; while (!isspace (*tempcp) && (*tempcp != '\0')) { tempcp++; } *tempcp = '\0'; /* now open the output file */ outfile = fopen (outfname, "wb"); if (outfile == null) { fprintf (stderr, "uudecode: couldn't open output file %s\n", outfname); exit (1); } /* now for the uu-decode proper */ do { if (fgets (linebuf, line_buf_size, infile) == null) { fprintf (stderr, "uudecode: read error\n"); exit (1); } /* the first byte of the line represents the length of the decoded line */ linelen = decode_byte (linebuf [0]); linep = linebuf + 1; for (linecnt = linelen; linecnt > 0; linecnt -= 3, linep += 4) { /* check for premature end-of-line */ if ((linep [0] == '\0') || (linep [1] == '\0') || (linep [2] == '\0') || (linep [3] == '\0')) { fprintf (stderr, "uudecode: error in encoded block\n"); exit (1); } /* decode the 4-byte block */ outbyte [0] = decode_byte (linep [0]); outbyte [1] = decode_byte (linep [1]); outbyte [0] <<= 2; outbyte [0] |= (outbyte [1] >> 4) & 0x03; outbyte [1] <<= 4; outbyte [2] = decode_byte (linep [2]); outbyte [1] |= (outbyte [2] >> 2) & 0x0f; outbyte [2] <<= 6; outbyte [2] |= decode_byte (linep [3]) & 0x3f; /* write the decoded bytes to the output file */ if (linecnt > 3) { if (fwrite (outbyte, 1, 3, outfile) != 3) { fprintf (stderr, "uudecode: error writing to output file\n"); exit (1); } } else { if (fwrite (outbyte, 1, linecnt, outfile) != linecnt) { fprintf (stderr, "uudecode: error writing to output file\n"); exit (1); } linecnt = 3; } } } while (linelen != 0); /* all is ok, tidy up and exit */ fclose (infile); fclose (outfile); return 0; } jim --<EMAIL_ADDRESS>|


WITNESS LIST Rural Development, Select Committee May 18, 2000-10:00A Education On: Barron, Glenda (Texas Higher Education Coordinating Board) Beaulieu, Dr. Lionel "Bo" (Souther Rural Development Center) Brockman, John (Self and Texas Association of Community Colleges) Cisneros, Marc (President, Texas A&M Kingsville) Health For: High, Harold R. (Self and Rural Community Health System) Ugarte, Jose M. (Self) Walker, Craig A. (Health Care Computer Corporation & Health Care Vision, Inc.) On: Folke, Lars (Center for Tele-Health, Baylor College of Dentistry) Harris, Thomas R. (Center for Rural Health Initiatives, Univerisity of Nevada, Reno) Keilers, Lance W. (Self and Ballinger Memorial Hospital District) Malone, Mary Frances (Self and Malone Associates) Miller, Camille D. (Self and Texas Institute for Health Policy Research) Patterson, Patti (Texas Tech Union Health Sciences Center) Prackyl, Dianna (Texas Dental Hygenists Association) Tessen, Robert J. "Sam" (Center for Rural Health Initiatives) Uresti, Gilberto (Self and Uresti Senior Assistance) Rural Dev For: Esquivel, Jr., Mayor Filemon "Phil" (Self and City of Kingsville) On: Berlanga, Hugo (Self) Cigainero, Barbara (Texas Workforce Commission) Harper, Dr. Sandra (Texas A&M University, Corpus Christi) Messbarger, Dick (Greater Kingsville Economic Development Council) Rosse, David (Self) Temple, Larry E. (Self and Texas Workforce Commission) Registering, but not testifying: On: Bruschetta, Humberto R. (Self) Martinez, Jose Leandro (Self and Resource Conservation & Development Areas of Texas)


2016 AUVSI SUAS Competition Day 4 - Final
Hi everyone,
We performed our competition flight today. We had a catastrophic crash; read on for more details about that. Here are some nice photos from before the crash.
We crashed shortly after takeoff; after performing a manual takeoff, going into auto-stabilized flight mode, then going into fully autonomous flight, the aircraft began maneuvering out of control. Rijesh attempted to manually recover the aircraft, but it was too late by that point.
Here are some photos of the debris; unfortunately we don’t have any other recovered photos (including from the plane’s camera) that show what happened during the crash.
Our hypotheses on what caused the crash, after looking at the debris and the logs:
- Poor wing alignment due to taking off and putting the wings back on at the flight line.
- Overspeed on the approach into the standby circle, due to the use of a new propeller with a different pitch.
- We noticed that the elevator had ripped off and had landed away from the other debris; we think that the elevator may have ripped off when the plane was approaching standby.
These are all just hypotheses; further testing is required to determine which one of these was the likeliest cause.
The final stats on overall team performance:
- 43 teams initially registered in this competition.
- 30 teams submitted journal papers.
- 24 teams successfully submitted the required safety pilot flight logs, proof of telemetry upload to the interoperaility server, and the proof of flight video.
- 24 teams passed the Flight Readiness Review and safety inspection and were able to fly.
- We obtained an overall ranking of 16, out of the 30 teams that submitted journal papers.
- We obtained a mission rank of 5, journal rank of 14, and a rank of 19 for our Flight Readiness Review. We tied for 5th on mission rank with a lot of other teams because we failed to meet the interoperability requirement for confirming that we successfully reached a flight waypoint. This is because we did not fly far enough to successfully reach a waypoint.
We’d like to thank the University of Alberta’s Faculty of Engineering, the Shell Enhanced Learning Fund, and the University of Alberta’s Students’ Union for helping to fund us over the past year and for this competition. We’d also like to thank Cameron Lee for his unwavering support, dedication, and advice over the past few years. Finally, we would like to thank our faculty advisors, Dr. Duncan Elliott and Dr. Michael Lipsett for their support of the club. We received some good advice from the judges on what to improve for next year’s competition and took note of the good practices from all the teams we met at competition, and are looking forward to doing better next year.
Cindy


Get access to our monthly gold price forecasts. Using natural language processing, Eribol forecasts gold price 6 months ahead, every month. Our methodology bridges the gap between technical and fundamental market analysis, and our results aide financial and risk strategy within the gold market.
| Date | $/oz | UCI | LCI |
|---|---|---|---|
| 2020-June | 1567 | 1881 | 1252 |
| 2020-May | 1645 | 2020 | 1269 |
| 2020-Apr | 1707 | 2132 | 1281 |
| 2020-Mar | 1706 | 2134 | 1278 |
| 2020-Feb | 1639 | 2020 | 1258 |
| 2020-Jan | 1529 | 1830 | 1228 |
*Data from July 2020 forecast. UCI = 95% Upper Confidence Interval, LCI = 95% Lower Confidence Interval
We aim to be transparent by openly publishing our models metrics. Time is precious, so our forecast reports are formatted to be as clear and concise as possible. If you have any questions regarding our forecasts, methodology or anything else, our team will be happy to answer.
| Length | RMSE | MSE | MAE |
|---|---|---|---|
| >5 Years | 91.7 | 8407.9 | 53.5 |
| 3 Years | 69.7 | 4808.5 | 31.4 |
| 1 Year | 113.3 | 12826.7 | 90.7 |
*RMSE =Root Mean Square Error, MSE = Mean Square Error, MAE = Median Absolute Error
*Yearly Mean Metrics, 2020 contains data up to June.
Find out what makes us unique, see our clear and transparent reporting style for November 2019.
DownloadIf you are interested in accessing our forecasts, contact us below for pricing and terms.
Get in touch


Edit Profile
||
Change Photo
May 05,2014,03:00 pm
Profile
This user have not complete his/her profile .
Oops!
Please complete your
Profile
Name
Username
Gender
Address
Email
Phone Number