Laravel First Try

Download composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer

Install laravel

$ cd /var/www/
$ composer create-project --prefer-dist laravel/laravel project-name
$ php artisan key:generate 

Edit file config/app.php

'key' => env('APP_KEY', 'uOHTNu3Au1Kt7Uloyr2Py9blU0J5XQ75'),

'cipher' => 'AES-256-CBC',

Create Apache VirtualHost

$ nano /etc/apache2/sites-available/project-name.com.conf
<VirtualHost *:80>

        ServerName laravel.example.com
        DocumentRoot /var/www/project-name/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/laravel>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
$ a2ensite project-name.com
$ sudo service apache2 reload

Access Laravel

$ sudo echo "127.0.0.1  project-name.com" >> /etc/hosts

And access http://project-name.com in your favorite web browser

Sumber: http://tecadmin.net/install-laravel-framework-on-ubuntu/

Iklan

Call Variable From String

Mulanya saya bingung, gimana sih cara mengambil nilai dari variabel, tapi nama variabel itu ada disimpan pada variable lain, untung nya ada mbah google yang setia membantu dikala bingung heheheheh…., nih contoh nya:
Baca lebih lanjut