Glossary

Accessor

A method defined on an Eloquent model that customizes how a given property will be returned. Accessors make it possible to define that getting a given property from a model will return a different (or, more likely, differently formatted) value than what is stored in the database for that property.

ActiveRecord

A common database ORM pattern, and also the pattern that Laravel’s Eloquent uses. In ActiveRecord the same model class defines both how to retrieve and persist database records and how to represent them. Additionally, each database record is represented by a single entity in the application, and each entity in the application is mapped to a single database record.

API

Technically application programming interface, but most commonly used to refer to a series of endpoints (and instructions on how to use them) that can be used to make HTTP-based calls to read and modify data from outside of a system. Sometimes, the term API is also used to describe the set of interfaces, or affordances, any given package or library or class exposes to its consumers.

Application test

Often called acceptance or functional tests, application tests test the entire behavior of the application, usually at an outer boundary, by employing something like a DOM crawler—which is exactly what Laravel’s application test suite offers.

Argument (Artisan)

Arguments are parameters that can be passed to Artisan console commands. Arguments aren’t prefaced with -- or followed by =, but instead just accept a single value.

Artisan

The tool that makes it possible to interact with Laravel applications from the command line.

Assertion

In testing, an assertion is the core of the test: you are asserting that something should be equal to (or less than or greater than) something else, or that it should have a given count, or whatever else you like. Assertions are the things that can either pass or fail.

Authentication

Correctly identifying oneself as a member/user of an application is the act of authentication. Authentication doesn’t define what you may do, but simply who you are (or aren’t).

Authorization

Assuming you’ve either succeeded or failed at authenticating yourself, authorization defines what you’re allowed to do given your particular identification. Authorization is about access and control.

Autowiring

When a dependency injection container will inject an instance of a resolvable class without a developer having explicitly taught it how to resolve that class, that’s called autowiring. With a container that doesn’t have autowiring, you can’t even inject a plain PHP object with no dependencies until you have explicitly bound it to the container. With autowiring, you only have to explicitly bind something to the container if its dependencies are too complex or vague for the container to figure out on its own.

beanstalkd

Beanstalk is a work queue. It’s simple and excels at running multiple asynchronous tasks—which makes it a common driver for Laravel’s queues. beanstalkd is its daemon.

Blade

Laravel’s templating engine.

BrowserKit

Laravel’s pre-5.4 testing facilities for DOM-based interactions, available as a Composer package for 5.4+ apps.

Carbon

A PHP package that makes working with dates much easier and more expressive.

Cashier

A Laravel package that makes billing with Stripe or Braintree, especially in subscription contexts, easier and more consistent and powerful.

Closure

Closures are PHP’s version of anonymous functions. A closure is a function that you can pass around as an object, assign to a variable, pass as a parameter to other functions and methods, or even serialize.

CodeIgniter

An older PHP framework that Laravel was inspired by.

Collection

The name of a development pattern and also Laravel’s tool that implements it. Like arrays on steroids, collections provide map, reduce, filter, and many other powerful operations that PHP’s native arrays don’t.

Command

The name for a custom Artisan console task.

Composer

PHP’s dependency manager. Like Ruby Gems or NPM.

Container

Somewhat of a catchall word, in Laravel “container” refers to the application container that’s responsible for dependency injection. Accessible via app() and also responsible for resolving calls to controllers, events, jobs, and commands, the container is the glue that holds each Laravel app together.

Contract

Another name for an interface.

Controller

A class that is responsible for routing user requests through to the application’s services and data, and returning some form of useful response back to the user.

CSRF (cross-site request forgery)

A malicious attack where an external site makes requests against your application by hijacking your users’ browsers (with JavaScript, likely) while they’re still logged in to your site. Protected against by adding a token (and a check for that token on the POST side) to every form on the site.

Dependency injection

A development pattern where dependencies are injected in from the outside—usually through the constructor—instead of being instantiated in the class.

Directive

Blade syntax options like @if, @unless, etc.

Dot notation

Navigating down inheritance trees using . to reference a jump down to a new level. If you have an array like ['owner' => ['address' => ['line1' => '123 Main St.']]], you have three levels of nesting. Using dot notation, you would represent “123 Main St.” as "owner.address.line1".

Dusk

Laravel’s frontend testing package that can test JavaScript (primarily Vue) and DOM interactions by spinning up ChromeDriver to run the tests.

Eager loading

Avoiding N+1 problems by adding a second smart query to your first query to get a set of related items. Usually you have a first query that gets a collection of thing A. But each A has many Bs, and so every time you get the Bs from an A, you need a new query. Eager loading means doing two queries: first you get all the As, and then you get all the Bs related to all those As, in a single query. Two queries, and you’re done.

Echo

A Laravel product that makes WebSocket authentication and syncing of data simple.

Elixir

Laravel’s old build tool, since replaced by Mix; a wrapper around Gulp.

Eloquent

Laravel’s ActiveRecord ORM. The tool you’ll use to define and query something like a User model.

Environment variables

Variables that are defined in an .env file that is expected to be excluded from version control. This means that they don’t sync between environments and that they’re also kept safe.

Envoy

A Laravel package for writing scripts to run common tasks on remote servers. Envoy provides a syntax for defining tasks and servers and a command-line utility for running the tasks.

Envoyer

A Laravel SaaS product for zero-down-time deployment, multiserver deploys, and server and cron health checks.

Event

Laravel’s tool for implementing a pub/sub or observer pattern. Each event represents that an event happened: the name of the event describes what happened (e.g., UserSubscribed) and the payload allows for attaching relevant information. Designed to be “fired” and then “listened” for (or published and subscribed, if you prefer the pub/sub concept).

Facade

A tool in Laravel for simplifying access to complex tools. Facades provide static access to core services in Laravel. Since every facade is backed by a class in the container, you could replace any call to something like Cache::put(); with a two-line call to something like $cache = app('cache'); $cache->put();.

Faker

A PHP package that makes it easy to generate random data. You can request data in different categories, like names, addresses, and timestamps.

Flag

A parameter anywhere that is on or off (Boolean).

Fluent

Methods that can be chained one after another are said to be fluent. In order to provide a fluent syntax, each method must return the instance, preparing it to be chained again. This allows for something like People::where('age', '>', 14)->orderBy('name')->get().

Flysystem

The package that Laravel uses to facilitate its local and cloud file access.

Forge

A Laravel product that makes it easy to spin up and manage virtual servers on major cloud providers like DigitalOcean and AWS.

FQCN (fully qualified class name)

The full namespaced name of any given class, trait, or interface. Controller is the class name; IlluminateRoutingController is the FQCN.

Gulp

A JavaScript-based build tool.

Helper

A globally accessible PHP function that makes some other functionality easier.

HMR (Hot Module Replacement)

A technology that makes it possible to reload just pieces of an active website’s frontend dependencies without reloading the entire file.

Homestead

A Laravel tool that wraps Vagrant and makes it easier to spin up Forge-parallel virtual servers for local Laravel development.

Horizon

A Laravel package that provides tooling for managing queues with greater nuance than Laravel’s defaults, and also provides insight into the current and historic operating state of the queue workers and their jobs.

Illuminate

The top-level namespace of all Laravel components.

Integration test

Integration tests test the way individual units work together and pass messages.

IoC (inversion of control)

The concept of giving “control” over how to make a concrete instance of an interface to the higher-level code of the package instead of the lower-level code. Without IoC, each individual controller and class might decide what instance of Mailer it wanted to create. IoC makes it so that the low-level code—those controllers and classes—just get to ask for a Mailer, and some high-level configuration code defines once per application which instance should be provided to satisfy that request.

Job

A class that intends to encapsulate a single task. Jobs are intended to be able to be pushed onto a queue and run asynchronously.

JSON (JavaScript Object Notation)

A syntax for data representation.

JWT (JSON Web Token)

A JSON object containing all of the information necessary to determine a user’s authentication state and access permissions. This JSON object is digitally signed, which is what makes it trustworthy, using HMAC or RSA. Usually delivered in the header.

Mailable

An architectural pattern designed to encompass the functionality of sending mail into a single “sendable” class.

Markdown

A formatting language designed for formatting plain text and outputting to multiple output formats. Commonly used for formatting text that has a good chance of being processed by a script or read by humans in its raw form—for example, Git READMEs.

Mass assignment

The ability to pass many parameters at once to create or update an Eloquent model, using a keyed array.

Memcached

An in-memory data store designed to provide simple but fast data storage. Memcached only supports basic key/value storage.

Middleware

A series of wrappers around an application that filter and decorate its inputs and outputs.

Migration

A manipulation to the state of the database, stored in and run from code.

Mix

A frontend build tool based on Webpack. Replaced Elixir in Laravel 5.4 and can be used to concatenate, minify, and pre-process your frontend assets, and much more.

Mockery

A library included with Laravel that makes it easy to mock PHP classes in your tests.

Model

A class used to represent a given database table in your system. In ActiveRecord ORMs like Laravel’s Eloquent, this class is used both to represent a single record from the system, and to interact with the database table.

Model factory

A tool for defining how the application can generate an instance of your model if needed for testing or seeding. Usually paired with a fake data generator like Faker.

Multitenancy

A single app serving multiple clients, each of which has its customers. Multitenancy often suggests that each client of your application gets its own theming and domain name with which to differentiate its service to its customers vis-à-vis your other clients’ potential services.

Mutator

A tool in Eloquent that allows you to manipulate the data being saved to a model property before it is saved to the database.

Nginx

A web server similar to Apache.

Notification

A Laravel framework tool allowing a single message to be sent via myriad notification channels (e.g., email, Slack, SMS) to one or more recipients.

Nova

A paid Laravel package for building admin panels for your Laravel apps.

NPM (Node Package Manager)

A central web-based repository for Node packages, at npmjs.org; also a utility used on your local machine to install a project’s frontend dependencies into the node_modules directory based on the specifications of package.json.

OAuth

The most common authentication framework for APIs. OAuth has multiple grant types, each of which describes a different flow of how consumers retrieve, use, and refresh the “tokens” that identify them after the initial authentication handshake.

Option (Artisan)

Like arguments, options are parameters that can be passed to Artisan commands. They’re prefaced with -- and can be used as a flag (--force) or to provide data (--userId=5).

ORM (object-relational mapper)

A design pattern that is centered around using objects in a programming language to represent data, and its relationships, in a relational database.

Passport

A Laravel package that can be used to easily add an OAuth authentication server to your Laravel app.

PHPSpec

A PHP testing framework.

PHPUnit

A PHP testing framework. The most common and connected to the most of Laravel’s custom testing code.

Polymorphic

In database terms, able to interact with multiple database tables with similar characteristics. A polymorphic relationship will allow entities of multiple models to be attached in the same way.

Preprocessor

A build tool that takes in a special form of a language (for CSS, one special form is LESS) and generates code with just the normal language (CSS). Preprocessors build in tools and features that are not in the core language.

Primary key

Most database tables have a single column that is intended to represent each row. This is called the primary key and is commonly named id.

Queue

A stack onto which jobs can be added. Usually associated with a queue worker, which pulls jobs one at a time from a queue, works on them, and then discards them.

React

A JavaScript framework. Created and maintained by Facebook.

Real-time facades

Similar to facades, but without requiring a separate class. Real-time facades can be used to make any class’s methods callable as static methods by importing that class with Facades in front of its namespace.

Redis

Like Memcached, a data store simpler than most relational databases but powerful and fast. Redis supports a very limited set of structures and data types but makes up for it in speed and scalability.

REST (Representational State Transfer)

The most common format for APIs these days. Usually suggests that interactions with an API should each authenticate separately and should be “stateless”; also usually suggests that the HTTP verbs are used for basic differentiation of requests.

Route

A definition of a way or ways the user might visit a web application. A route is a pattern definition; it can be something like /users/5, or /users, or /users/id.

S3 (Simple Storage Service)

Amazon’s “object storage” service, which makes it easy to use AWS’s incredible computing power to store and serve files.

SaaS (Software as a Service)

Web-based applications that you pay money to use.

Scope

In Eloquent, a tool for defining how to consistently and simply narrow down a query.

Scout

A Laravel package for full-text search on Eloquent models.

Serialization

The process of converting more complex data (usually an Eloquent model) to something simpler (in Laravel, usually an array or JSON).

Service provider

A structure in Laravel that registers and boots classes and container bindings.

Socialite

A Laravel package making it simple to add social authentication (e.g., login via Facebook) to Laravel apps.

Soft delete

Marking a database row as “deleted” without actually deleting it; usually paired with an ORM that by default hides all “deleted” rows.

Spark

A Laravel tool that makes it easy to spin up a new subscription-based SaaS app.

Symfony

A PHP framework that focuses on building excellent components and making them accessible to others. Symfony’s HTTP Foundation is at the core of Laravel and every other modern PHP framework.

Telescope

A Laravel package for adding a debugging assistant to Laravel apps.

Tinker

Laravel’s REPL, or read–evaluate–print loop. It’s a tool that allows you to perform complex PHP operations within the full context of your app from the command line.

TL;DR

Too long; didn’t read. “Summary.”

Typehinting

Prefacing a variable name in a method signature with a class or interface name. Tells PHP (and Laravel, and other developers) that the only thing that’s allowed to be passed in that parameter is an object with the given class or interface.

Unit test

Unit tests target small, relatively isolated units—a class or method, usually.

Vagrant

A command-line tool that makes it easy to build virtual machines on your local computer using predefined images.

Valet

A Laravel package (for Mac OS users, but there are forks for macOS and Windows) that makes it easy to serve your applications from your development folder of choice, without worrying about Vagrant or virtual machines.

Validation

Ensuring that user input matches expected patterns.

View

An individual file that takes data from the backend system or framework and converts it into HTML.

View composer

A tool that defines that, every time a given view is loaded, it will be provided a certain set of data.

Vue

A JavaScript framework. Preferred by Laravel. Written by Evan You.

Webpack

Technically a “module bundler,” Webpack is a tool commonly used to run frontend build tasks, especially those that involve processing CSS and JavaScript and other frontend source files and outputting them in a more production-ready format.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.111.9