Home » ebook
Category Archives: ebook
PHP, a free and open source programming language, is continuing renaissance and Laravel is at the forefront. Laravel 5 is proving to be the most usable framework for novice and expert programmers alike. Following modern PHP’s object-oriented best practices, reduce the time to market and build robust web and API-driven mobile applications that can be automatically tested and deployed.
You will learn how to rapidly develop software applications using the Laravel 5 PHP framework.
What this book covers
Chapter 1, Designing Done Right with phpspec, speaks about how to configure Laravel 5 for phpspec to perform modern unit testing, to use phpspec to design classes, and to perform unit and functional testing.
Chapter 2, Automating Tests – Migrating and Seeding Your Database, covers database migrations, the mechanics behind them and how to create a seed for testing.
Chapter 3, Building Services, Commands, and Events, talks about Model-View-Controller
and how has evolved into services, commands, and events to decouple code and practice separation of concerns.
Chapter 4, Creating RESTful APIs, takes you through the creation of a RESTful API: the basic CRUD operations (create, read, update, and delete), as well as discussing some best practices and hypermedia controls (HATEOAS).
Chapter 5, Using the Form Builder, takes you to the web interface side of things and shows you how to take advantage of the some of the newest features of Laravel 5 to create web forms. Reversed routing will be discussed here as well.
Chapter 6, Taming Complexity with Annotations, focuses on annotations. The routes. php file easily becomes messy when an application grows in complexity. Using annotations inside of controllers, code legibility is drastically increased; however, there are some disadvantages in addition to the advantages.
Chapter 7, Filtering Requests with Middleware, shows you how to create reusable filters that can be called either before or after the controllers.
Chapter 8, Querying the Database with the Eloquent ORM, helps you learn how to use an ORM in a way to reduce the probability of errors in coding, increase the security and reduction of SQL-injection probability, and also learn how to deal with the limits of the Eloquent ORM.
Chapter 9, Scaling Laravel, speaks about scaling an application to move it into a cloudbased architecture. The read/write master/slave configuration is discussed and the reader is guided through the configuration.
Chapter 10, Building, Compiling, and Testing with Elixir, introduces Elixir. Elixir is based on gulp, which is a task runner and is a series of build scripts that automates common tasks in the Laravel software development workflow.
What you need for this book
We’ll need the following software:
• PHP 5.4 or greater
• MySQL or similar
Who this book is for
If you are an experienced novice or a capable PHP programmer who has a basic understanding of the concepts of modern PHP (at least version 5.4), then this book is ideal for you.
If you are associated with the field of web development, you know how important data is. The web runs on data, so it’s essential for developers to think of quick and effective ways to deal with it. Eloquent is an awesome ORM that comes with the Laravel PHP framework. It is unique and is very beneficial to developers as it allows them to define models, relationships, and many complex operations with a really easy and intuitive syntax, without sacrificing performance. Performing an interesting number of operations on multiple tables without writing long queries with objects will be a bed of roses.
This book will take you through developing brilliant data-based applications with Eloquent, the Laravel framework ORM.
You will do the following:
• Build highly efficient applications with the Eloquent ORM using an
• Get to grips with the power of relationships and how Eloquent handles them
• Go beyond simple theory with various step-by-step code examples
So, let’s get started!
What this book covers
Chapter 1, Setting Up Our First Project, will discuss how to deal with Composer and Homestead. We will also cover the installation process of our very first Laravel project.
Chapter 2, Building the Database with the Schema Builder Class, will discuss the Schema Builder Class. We will analyze everything you can do with the class, look at different types of indexing, and learn about the methods that the Schema class provides.
; “> Chapter 3, The Most Important Element – the Model!, will help us implement some
“create,” “read,” “update,” and “delete” logic for our items. We will also explore
some useful methods and features of the model class.
Chapter 4, Exploring the World of Relationships, will help us discover how to work with different types of relationships and how to query and use them in a comfortable and clean way. Also, we will learn how to insert and delete related models in our database, or update existing ones.
Chapter 5, Using Collections to Enhance Results, will talk about collections. We will work with some results transformation methods and with the elements that make up a collection.
Chapter 6, Everything under Control with Events and Observers, will allow us to learn everything about the events in the context of Eloquent models. Right after, we will cover model events and model observers.
Chapter 7, Eloquent… without Laravel!, will explore the structure of the database package and see what is inside it. After that, we will learn how to install the “illuminate/database” package separately for your project and how to configure it for its first use. Yes, exactly: Eloquent without Laravel!
Chapter 8, It’s Not Enough! Extending Eloquent, Advanced Concepts, will explore two different ways to extend Eloquent, and move on to learn about the Repository pattern.
Application frameworks have grown in popularity over the past five years. There has been a tremendous shift from handwriting all code to leveraging these powerful frameworks with prebuilt components and features. However, with anything that comes to be in fashion, there are now a lot of contending options, and each of them viable.
While CodeIgniter was one of the first frameworks to enjoy widespread popularity, this popularity would come to be its undoing years later, as its large spread use and low barrier to entry meant it couldn’t take advantage of newer versions of PHP without losing backwards compatibility, and potentially breaking lots of applications. This saw it then be surpassed by faster-moving alternatives such as Symfony and even FuelPHP, which was developed as a response to CodeIgniter’s unwillingness to embrace change.
Enter: Laravel.Laravel joined the framework scene when there were already many players. However, the developers of Laravel used this timing to their advantage,
instead creating a framework that avoided all of the problems and mistakes previous full stack frameworks had made and building on top of the excellent Symfony components in order to create a robust, component-based framework.
Instead of providing dozens of inflexible libraries, Laravel provides sensible,
driver-based components that developers could use to build applications their own way, rather than trying to mash everything into the layout the framework author defined. This led to Laravel rising in popularity. It was also a fast-moving framework, and, by version 4, had become the most starred framework on GitHub, a testament to its popularity.
This book will give you a tour of Laravel and its core features. We’ll look at how to manage multiple Laravel applications on the same machine and then we’ll go ahead and start building our own Laravel application from scratch through to completion.
Once we’ve got a basic application reading and writing data from a database, we’ll take a look at Eloquent, Laravel’s ORM, which is what makes it easy to read and write from a database and the more advanced features it offers. From there, we’ll look at Artisan, Laravel’s command-line utility, and even how to define our own commands. We’ll then learn how to write automated tests for our application to make sure it keeps working the way we want it to, even with future developments. Then, finally, we’ll look at how to build login and registration systems using Laravel’s user authentication component.
By the end of the book, you’ll have a complete Laravel application, as well as the tools and knowledge of how to build your own Laravel-based applications unassisted, and where to continue your learning of the framework.
Long Term Support
Laravel version 5.1 is the first LTS (long term support) Laravel release. This means bug fixes are provided for 2 years and security fixes are provided for 3 years.
This is important because the applications you build today will still be supported by the framework tomorrow.
Why This Book
My previous book on Laravel, Getting Stuff Done with Laravel 4 was well received.
Now that Laravel 5.1 is available, I briefly thought of updating my previous book to work with Laravel 5.1. The new version of Laravel implements big changes from Laravel 4, but Laravel 5.1 is mostly backwards compatible.
But the Getting Stuff Done with Laravel 4 book isn’t really a manual covering every aspect of Laravel 4. It’s a process and design book. The principles discussed within that book still are valid in Laravel 5.1, even if the implementation may vary slightly.
Instead of updating my previous book, I’ve created a new book, Laravel 5.1 Beauty, to highlight some of the new features. This book is bigger and better than Getting Stuff Done with Laravel 4.
GitHub and the Blog
I’m publishing Laravel 5.1 Beauty simultaneously, as it is being built, on my web site
LaravelCoding.com and on Leanpub.
I’ve spent the vast majority of the past 15 years immersed in the PHP language. During this time I’ve written seven PHP-related books, including a bestseller that has been in print for more than ten years. Along the way I’ve worked on dozens of PHP-driven applications for clients ranging from unknown startups to globally-recognized companies, penned hundreds of articles about PHP and web development for some of the world’s most popular print and online publications, and instructed hundreds of developers in the United States and Europe. So you might be surprised to learn that a few years ago I became rather disenchanted with PHP. It felt like there were more exciting developments taking place within other programming communities, and wanting to be part of that buzz, I wandered off. In recent years, I spent the majority of my time working on a variety of projects including among others several ambitious Ruby on Rails applications and even a pretty amazing Linux-powered robotic device.
Laravel aims to make the development process a pleasing one for the developer without sacrificing application functionality. Happy developers make the best code. To this end, we’ve attempted to combine the very best of what we have seen in other web frameworks, including frameworks implemented in other languages, such as Ruby on Rails, ASP.NET MVC, and Sinatra.
Now that’s something to get excited about! In the pages to follow I promise to add you to the ranks of fervent Laravel users by providing a wide-ranging and practical introduction to its many features.
Why The Book? Well, it’s not really a book… It’s more of a guide (hence the title).
A guide to save yourself and others from becoming a zombie developer!
What exactly is a zombie developer? Well, a zombie developer is a developer like you or I, yet they mindlessly hack on PHP apps and do the same thing over and over.
These repetitive tasks are incredibly time consuming, and make the developer brain dead. When this happens it gives them a thirst for blood and an urge to kill.
So, instead of letting this happen the developer could have used the amazing Laravel framework for rapid application development. This will help them keep their sanity and it will make coding enjoyable again. Oh, yeah… And it’ll save lives.
By learning the basics of Laravel you can save yourself, and possibly others, from
becoming a deteriorating zombie developer.
Don’t let that inner zombie revive, be sure to keep in hand this Laravel survival guide.
From the New File Structure to Method Injection, Everything Explained (Sanjib Sinha).
Web Programming Simplified Series
This series is, basically, meant for the beginners who just want to make their hands dirty with codes and try to be a good web programmer! Intermediate and Advanced web programmers may find some parts thought provoking
Prologue to Laravel 5.2
Well, this will be a fairly good repetition if I am going to tell you, what Laravel is! Even if you are a beginner, you have already heard about what Laravel is – an ubiquitous and omnipresent intelligent PHP framework which has stormed the PHP world with a lot of modular varieties in its code repositories.
At a glance Laravel 5 Onwards
Laravel : An MVC Framework
MVC = Model-View-Controller
Software structure with emphasize on Modularity
Model : Application Data and Function
View : Representation of Output, e.g. HTML
Controller : Interacts with user, model and view
It has traversed a fairly long way in a very short period of time and won PHP developer’s hearts with one after another strong blows.
PHP powers many of the largest websites on the planet. Yet, even though it was specifically created for the Web, its shortcomings never cease to frustrate developers. This is where a tool like Laravel comes in. Rather than reinventing the wheel, Laravel reuses tried and tested components and principles and bundles them to form a cohesive whole and makes PHP development enjoyable again. Getting Started with Laravel 4 is a practical and concise introduction to the Laravel PHP framework. It covers its fundamental concepts and presents the many features that will boost your productivity when developing web applications. After introducing the key concepts and installing Composer, you will build a CRUD application and add more features to it in each successive chapter.