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!
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:
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:
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!
app/config/database.php
and configure connection settings for your database.Configure hostname in bootstrap/start.php
file to match your machine's hostname:
$env = $app->detectEnvironment(array(
'local' => array('your-machine-name'), // Edit this line
));
app/config/social.php
. Also make sure you're using http://<your-site.com>/login/github
for Authorization callback URLAfter this simple configuration you can populate the database by running a couple commands shown below.
CD into the directory of this project and run the following three commands:
composer install
php artisan migrate
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.
While the code of the application is heavily documented it helps to know how the code is structured and what standards it follows.
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:
GithubEmailNotVerifiedException
) extend the Tricks\AbstractNotFoundException
class. This makes it much easier to handle 404 errors. (The handling can be found in the app/start/global.php
file).app/config/navigation.php
.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.
Contributions to this repository are more than welcome although not all suggestions will be accepted and merged with the live site.
Keep track of development and Laravel-Tricks news.
Stidges
Maksim Surguy
Code released under the MIT license.