All the recipes organized into a Table of Contents
Part I - General Laravel Development
Recipes dealing with general Laravel development.
Recipes providing solutions to finding additional Laravel help.
Recipes providing instructions on setting up your development environment.
Recipes dealing with general Laravel configuration and the configuration of the machine running Laravel applications.
- Editing the Hosts File
- Creating an Apache VirtualHost
- Creating a Nginx VirtualHost
- Environment Specific Configurations
- Detecting the Environment with a Closure
- Using Environment Specific Start Files
- Changing the Storage Path
- Changing Storage Path Permissions
- Using a PSR-0 Directory Structure
- Creating a Helpers File
- Where to Keep Your Application Bindings
Recipes dealing with basic Laravel development. Topics like creating projects, setting up routes, basic controller usage, and so forth.
Part II - Laravel Components
Recipes dealing directly with Laravel components.
Recipes dealing with Laravel's App facade
- Checking Your Environment
- Checking if You're Running in the Console
- Storing a Value in the IoC Container
- Binding an Interface to an Implementation
- Resolving Objects from the IoC Container
- Registering a Before Application Filter
- Registering an After Application Filter
- Registering a Shutdown Callback
- Calling the Registered Shutdown Callbacks
- Checking if the Application is Booted
- Registering Booting or Booted Callbacks
- Registering HttpKernel Middleware
- Removing Middleware from the Application
- Checking if the Application is Down for Maintenance
- Registering a Maintenance Mode Handler
- Getting the Application Bootstrap File
- Registering a Service Provider With the Application
- Registering a Finish Callback
- Determining if the Application is Ready for Responses
- Throwing HttpExceptions
- Registering a 404 Error Handler
- Registering an Error Handler
- Registering a "Last Chance" Error Handler
- Registering an Error Handler for Fatal Errors
- Getting the Current Application Locale
- Set the Current Application Locale
- Getting the Default Request Class
- Setting the Request for the Console Environment
- Calling a Static Method on the Default Request Class
Recipes dealing with Laravel's Artisan command
- Displaying Laravel's Change Log
- Displaying the Current Environment
- Listing Your Routes
- Clearing the Compiled Class
- Optimizing the Framework for Better Performance
- Putting the Application in Maintenance Mode
- Bringing the Application Out of Maintenance Mode
- Creating the Migration Repository
- Creating a New Migration
- Running Database Migrations
- Rolling Back the Last Database Migration
- Rolling Back All Database Migrations
- Resetting and Re-running All Migrations
- Seeding Your Database
- Creating a Migration for Sessions
- Creating a Migration for Password Reminders
- Clearing Expired Password Reminders
- Creating a Reminders Controller
- Creating a New Package Workbench
- Clearing the Application Cache
- Publishing a Package's Configuration to Your Application
- Publishing a Package's Views to Your Application
- Publishing a Package's Assets to Your Public Directory
- Interacting With Your Application
- Tailing a Log File on a Remote Server
- Running PHP's Built-in Web Server
- Generating a New Application Key
- Creating a New Artisan Command
Recipes dealing with Laravel's Auth facade
- Changing Your Authentication Driver
- Changing Your Authentication Model
- Changing Your Authentication Table
- Changing the View For Password Reminders
- Changing the Password Reminder Expiration
- Changing Your Password Reminder Table
- Artisan Password Reminder Commands
- Determining if the Current User is Authenticated
- Determining if No User is Logged In
- Accessing the Current User
- Determine if the User Was Authenticated Via the Remember Cookie
- Creating an Instance of the Auth Database Driver
- Creating an Instance of the Auth Eloquent Driver
- Logging a User In Without Sessions or Cookies
- Validating a User's Credentials
- Attempting to Authenticate Using Basic Auth
- Performing a Stateless HTTP Basic Login
- Attempting to Authenticate with Credentials
- Listening for Authentication Attempts
- Manually Logging a User In
- Manually Logging a User by ID
- Logging in a User by ID Without Sessions or Cookies
- Logging the User Out of Your Application
- Getting the Cookie Jar Used for Authentication
- Setting the Cookie Jar Used for Authentication
- Getting the Remember Me Cookie Name
- Getting the Cookie Name Used for Authentication
- Getting the Currently Cached Authenticated User
- Setting the Currently Authenticated User
- Getting the Event Dispatcher for Authentication
- Setting the Event Dispatcher for Authentication
- Getting the Authentication Request Instance
- Setting the Request Instance for Authentication
- Getting the Authentication User Provider
- Setting the Authentication User Provider
- Getting the Session Store Used for Authentication
Recipes dealing with the Blade template engine
- Using Blade Layouts to Extend Templates
- Outputting the Content of a Blade Section
- Displaying a Variable in a Blade Template
- Using @if Control Structures in Blade
- Using the @unless Control Structure in Blade
- Using Comments in Blade Templates
- Using @for Control Structures in Blade
- Using @foreach Control Structures in Blade
- Using @while Control structures in Blade
- Including a Blade Template within another Template
- Rendering a View For Items in a Collection
- Yielding the Current Section in a Blade Template
- Starting to Inject Content into a Blade Section
- Stopping Injecting Content Into a Section
- Stopping Injecting Content into a Section and Appending It
- Stopping Injecting Content into a Section and Overwriting
- Pulling in the Content of a Parent Section in Blade
- Setting the Content Tags Blade Uses
- Setting the Escaped Content Tags Blade Uses
- Outputting a Translation in a Blade Template
- Outputting a Translation With Pluralization in a Blade Template
- Knowing All the Blade Template Commands
- Assigning a Variable in a Blade Template
Recipes dealing with Laravel's Cache facade
- Setting Up the File Cache Driver
- Setting Up the Database Cache Driver
- Setting up the APC Cache Driver
- Setting up the Memcached Cache Driver
- Setting up the Redis Cache Driver
- Setting up the Array Cache Driver
- Setting up the WinCache Cache Driver
- Setting up the XCache Cache Driver
- Organizing Your Cache into Sections
- Determining if an Item Exists in the Cache
- Getting a Cache Driver Instance
- Getting All Created Cache Drivers
- Getting the Cache Prefix Value
- Retrieving an Item From the Cache
- Storing an Item in the Cache
- Storing an Item in the Cache if it Doesn't Exist
- Retrieving an Item from the Cache or Storing a Default
- Storing an Item in the Cache Forever
- Getting an Item from the Cache or Storing a Default Forever
- Removing an Item from the Cache
- Incrementing the Value of an Item in the Cache
- Decrementing the Value of an Item in the Cache
- Removing All the Items From the Cache
- Using a Cache Key Prefix
Recipes dealing with Laravel Controllers.
Recipes dealing with Laravel's Cookie component.
Recipes dealing with Laravel's Crypt component.
Recipes dealing with Laravel's File facade.
- Determining If a File Exists
- Getting the Contents of a File
- Getting the Contents of a Remote File
- Getting the Return Value of a File.
- Requiring a File Once
- Writing the Contents of a File
- Prepending to a File
- Appending to a File
- Deleting a File
- Moving a File to a New Location
- Copying a File to a New Location
- Extracting a File Extension From a Path
- Getting the Type of a File
- Getting the Size of a File
- Getting a File's Last Modification Time
- Determining if a Path is a Directory
- Determining if a File or Directory is a Writable
- Determining if a Path is a File
- Finding Files Matching a Pattern
- Getting a List of All Files in a Directory
- Getting All the Files Recursively From a Directory
- Getting All the Directories in a Directory
- Creating a Directory
- Copying a Directory From One Location to Another
- Recursively Deleting a Directory
- Emptying a Directory of All Files and Folders
Recipes dealing with Laravel's Form facade.
- Opening a New HTML Form
- Creating a New Model Based Form
- Closing the Current Form
- Generating a Hidden Field With the CSRF Token
- Creating a Form Label Element
- Creating a Password Input Field
- Creating a Text Input Field
- Creating a Hidden Input Field
- Creating an Email Input Field
- Creating a URL Input Field
- Creating a File Input Field
- Creating a Form Input Field
- Creating a Textarea Input Field
- Creating a Select Box Field
- Creating a Select Range Field
- Creating a Select Year Field
- Creating a Month Selection Field
- Creating a Checkbox Input Field
- Creating a Radio Button Input Field
- Creating a Reset Input Field
- Creating an Image Input Element
- Creating a Submit Button
- Creating a Button Element
- Getting the ID Attribute For a Field Name
- Getting the Value Attribute a Field Should Use
- Getting a Value From the Session's Old Input
- Determining if the Old Input is Empty
- Getting the Session Store
- Setting the Session Store Implementation
- Getting the Select Option for a Value
Recipes dealing with Laravel's Hash facade.
Recipes dealing with Laravel's HTML facade.
- Converting a HTML String to Entities
- Decoding HTML Entities to a String
- Generating a Link to a Javascript File
- Generating a Link to a CSS File
- Generating an HTML Image Element
- Generating a HTML Link
- Generating a Secure HTML Link
- Generating a HTML Link to an Asset
- Generating a Secure HTML Link to an Asset
- Generating a HTML Link to a Named Route
- Generating a HTML Link to a Controller Action
- Generating a HTML Link to an Email Address
- Obfuscating an Email Address
- Generating an Ordered List of Items
- Generating an Unordered List of Items
- Bulding an HTML Attribute String From an Array
- Obfuscating a String
Recipes dealing with Laravel's Lang facade.
- Getting the Translation for a Key
- Determining if a Translation Exists
- Getting a Translation Using Pluralization Rules
- Getting the Default Locale Being Used
- Setting the Default Locale
- Parsing a Language Key into its Components
- Adding a New Namespace to the Message Loader
- Getting the Translation Message Selector
- Setting the Translation Message Selector
- Listening for Locale Changes
Part III - Database
Recipes dealing with the database.
Recipes dealing with setting up and configurating databases with Laravel.
Part IV - Extending Laravel
Recipes extending Laravel in various ways.
Recipes dealing with Extending Laravel's Core Components
Recipes dealing with Service Providers
Recipes dealing with Laravel's Middleware
Recipes dealing with Packages Provided by 3rd Parties
