sexta-feira, 20 de maio de 2016

Change laravel path

With this "new"/"better" method, you don't put that in /public/index.php. In fact, you don't put that function anywhere.
In the simplest terms possible (basically, duplicating the correct [though, not accepted] answer on StackOverflow):
1.) In /bootstrap/app.php (not /public/index.php!), change the $app variable's declaration to this:
$app = new Illuminate\Foundation\Application(
    realpath(__DIR__.'/../')
);
To be clear, in an unmodified installation, the lines to be replaced with the above snippet are here:https://github.com/laravel/laravel/blob/master/bootstrap/app.php#L14-L16
2.) Create the file /app/Application.php. Populate it with the following contents:
<?php namespace App;

class Application extends \Illuminate\Foundation\Application
{

public function publicPath()
{
    return $this->basePath . '/../../web';
}

}
Be sure to change the return value in the above method to reflect the actual path to the desired public directory on your system.
That's all there is to it! Happy to answer any questions if you're still stuck.

quinta-feira, 19 de maio de 2016

Create Database with grant access


create database {db};
use {db};
GRANT ALL PRIVILEGES ON {db}.* TO '{user}'@'localhost' IDENTIFIED BY '{password}';

Laravel Fast Initialization

Laravel init

Via Laravel Installer

composer global require "laravel/installer"
laravel new blog

Directory Permissions

storage and the bootstrap/cache
sudo chown -R www-data:www-data bootstrap/cache/
sudo chown -R www-data:www-data storage/
sudo chmod -R -x+Xrw bootstrap/cache/
sudo chmod -R -x+Xrw storage/

Application Key

php artisan key:generate

Administration
php artisan make:auth