composer create-project laravel/laravel --prefer-dist PROJECT
```jo
This will setup a new laravel project in PROJECT subfolder of current folder, and set the encryption key.
## Development dependecies
Things that I find useful for development in every project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# /PUBLIC folder .htaccess | |
# ---------------------------------------------------------------------- | |
# This .htaccess file is recommended | |
# to be placed at root/public folder | |
# of your Laravel powered application | |
# ---------------------------------------------------------------------- | |
# This file works with Laravel 3 and 4 | |
# ---------------------------------------------------------------------- | |
# Turning on the rewrite engine is necessary for the following rules and |
#Простой пост с комментариями
##Миграции
Эта миграция для таблицы posts
:
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostsTable extends Migration {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Process_Manager implements Countable | |
{ | |
protected $processes = array(); | |
protected $is_child = FALSE; | |
public function count() | |
{ | |
return count($this->processes); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Sharing Laravel's session and checking authentication | |
|-------------------------------------------------------------------------- | |
| | |
| Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder, | |
| KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into | |
| the Laravel framework, with session support, and check if the user is authenticated. |
#A BADASS list for faster Web Development!
Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!
Frameworks | Weapons | Checklist | Docs | Community | Learning | For The Win
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function redirect_back_or_default($url = null){ | |
try{ | |
return Redirect::back(); | |
}catch(Exception $e){ | |
return Redirect::to($url); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# ROOT/ folder .htaccess | |
# ---------------------------------------------------------------------- | |
# Laravel Note: | |
# Note: Laravel is designed to protect your application code, | |
# and local storage by placing only files that are necessarily | |
# public in the public folder. It is recommended that you either | |
# set the public folder as your site's documentRoot (also known as a web root) | |
# or to place the contents of public into your site's root directory | |
# and place all of Laravel's other files outside the web root. |
OlderNewer