Book Image

Laravel Application Development Blueprints

By : Arda Kılıçdağı, Halil İbrahim Yılmaz
Book Image

Laravel Application Development Blueprints

By: Arda Kılıçdağı, Halil İbrahim Yılmaz

Overview of this book

<p>Laravel is a clean and classy framework for PHP web development. It helps you to create wonderful applications using simple, expressive syntax. Development should be a creative and enjoyable experience, not something that is painful, and Laravel makes it enjoyable for the users. Laravel's directory structure is designed to be familiar to users of other popular PHP frameworks. Web applications of any shape or size can easily be created using this structure similar to the way that they would be created in other frameworks. With the recently released 4th Version, Laravel became even better in numerous ways. Within this book, we will help you learn about both the old and new features of Laravel while developing various applications.</p> <p>Laravel Application Development Blueprints covers how to develop 10 different applications step-by-step using Laravel 4. You will also learn about both basic and advanced usage of Laravel’s built-in methods, which will come in handy for your project. Also, you will learn how to extend the current libraries with the built-in methods and include third-party libraries.</p> <p>This book looks at the Laravel PHP framework and breaks down the ingrained prejudice that coding with PHP causes due to spaghetti code. It will take you through a number of clear, practical applications that will help you to take advantage of the Laravel PHP framework and PHP OOP programming whilst avoiding spaghetti code.</p> <p>You'll also learn about creating secure web applications using different methods such as file uploading and processing, making RESTful AJAX requests, and form processing. If you want to take advantage of the Laravel PHP framework's validate, file processing, and RESTful controllers in various types of projects, then this is the book for you.<br />Everything you need to know to code fast and secure applications with the Laravel PHP framework will be discussed in this book.</p>
Table of Contents (17 chapters)
Laravel Application Development Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Setting custom configuration values


With Laravel, setting configuration values is quite easy. All config values are within an array and will be defined as a key=>value pair.

Now let's make a new configuration file. Save this file as image.php in app/config:

<?php

/**
 * app/config/image.php
*/

return array(

  //the folder that will hold original uploaded images
  'upload_folder' => 'uploads',

  //the folder that will hold thumbnails
  'thumb_folder' => 'uploads/thumbs',

  //width of the resized thumbnail
  'thumb_width' => 320,

  //height of the resized thumbnail
  'thumb_height' => 240

);

You can set any other setting as you like. That's limited to your imagination. You can call the settings with Laravel's built-in Config Library's get() method. Sample usage is as shown in the following code:

Config::get('filename.key')

There is a dot (.) between the parameter, which splits the string into two. The first part is the filename of the Config without the extension, the second...