Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Laravel 5 Essentials
  • Table Of Contents Toc
Laravel 5 Essentials

Laravel 5 Essentials

By : Martin Bean
3.7 (13)
close
close
Laravel 5 Essentials

Laravel 5 Essentials

3.7 (13)
By: Martin Bean

Overview of this book

This book is intended for PHP web developers who have an interest in Laravel and who know the basics of the framework in theory, but don't really know how to use it in practice. No experience of using frameworks is required, but it is assumed you are at least familiar with building dynamic websites in PHP already.
Table of Contents (10 chapters)
close
close
9
Index

Array helpers

Arrays are the bread and butter of any web application that deals with data. PHP already offers nearly 80 functions to perform various operations on arrays, and Laravel complements them with a handful of practical functions that are inspired by certain functions found in Python and Ruby.

Note

Several of Laravel's classes, including Eloquent collections, implement the PHP ArrayAccess interface. This means that you can use them like a normal array in your code and, for instance, iterate over the items in a foreach loop or use them with the array functions described here.

Most of the functions support a dot notation to refer to nested values, which is similar to JavaScript objects. For example, rather than writing $arr['foo']['bar']['baz'], you can use the array_get helper and write array_get($arr, 'foo.bar.baz');.

In the following usage examples, we will use three dummy arrays and assume that they are reset for each example:

$associative...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Laravel 5 Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon