CodepadME / laravel-tricks

The source code for the Laravel Tricks website
http://laravel-tricks.com
MIT License
967 stars 297 forks source link

Laravel-Tricks

Laravel-Tricks is now under the ownership of Tighten, and all development is taking place under a private repo until we can extract some of its code and make it public.

This is an archive of an old public version of the codebase the previous owners created and kept in sync with their private version.


Laravel Tricks is a website created by Stidges and Maksim Surguy as an unofficial repository of tips and tricks for web developers using the Laravel PHP framework.

To see what this is about check out http://www.laravel-tricks.com!

Table of contents

Purpose and Features

The purpose of this repository is to provide a source of a real website that's using the Laravel PHP Framework and implements good design patterns for its architecture.

The features of Laravel-Tricks are:

Requirements

The Laravel-Tricks website requires a server with PHP 5.4+ that has the MCrypt extension installed.

The database engine that is used to store data for this application could be any of the engines supported by Laravel such as:

Quick Start and Installation

To get started and start making something of your own using this repository as a base: download this repository, create an empty database that this application will use, configure a few settings in the app/config folder and enjoy!

Configuration

After this simple configuration you can populate the database by running a couple commands shown below.

Installation

CD into the directory of this project and run the following three commands:

  1. composer install
  2. php artisan migrate
  3. php artisan db:seed

This will install all Composer dependencies, create the database structure and populate the database with some sample data so that you could see this project in action.

Documentation

While the code of the application is heavily documented it helps to know how the code is structured and what standards it follows.

Project structure

To start, we have removed the app/models directory and created a custom namespace for the site. This namespace houses all of the application's domain classes.

After that, we have namespaced the app/Controller directory, so that whenever new controllers are created composer dump-autoload doesn't have to be called every time.

The domain classes can be found in the app/Tricks directory. This contains all the application's logic. The controllers merely call these classes to perform the application's tasks.

The app/Tricks directory is structured in the following manner:

Standards

The Laravel-Tricks application is PSR-2 compliant (and PSR-0 and PSR-1, which PSR-2 extends). PSR-2 is a coding standard by PHP-FIG which aims to unify the way PHP code gets written, so that everyone collaborating on a project will adhere to the same standards. This makes the code easier to read and understand.

Contributing

Contributions to this repository are more than welcome although not all suggestions will be accepted and merged with the live site.

Community

Keep track of development and Laravel-Tricks news.

Authors

Stidges

Maksim Surguy

Copyright and license

Code released under the MIT license.