Skip to content

Instantly share code, notes, and snippets.

@WISHPRO
WISHPRO / .htaccess
Last active August 29, 2015 14:12 — forked from vluzrmos/.htaccess
# ----------------------------------------------------------------------
# /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

Installation/configuration

Create laravel project

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.

#Простой пост с комментариями ##Миграции Эта миграция для таблицы posts:

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostsTable extends Migration {
<?php
class Process_Manager implements Countable
{
protected $processes = array();
protected $is_child = FALSE;
public function count()
{
return count($this->processes);
<?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.
<?php
function redirect_back_or_default($url = null){
try{
return Redirect::back();
}catch(Exception $e){
return Redirect::to($url);
}
}
@WISHPRO
WISHPRO / .htaccess
Last active August 29, 2015 14:16 — forked from dr-dimitru/.htaccess
# ----------------------------------------------------------------------
# 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.