Beruflich Dokumente
Kultur Dokumente
0)New aplication
gitbash -> cd homestead
vagrant up —-provision - da restartuje ngix
composer create-project laravel/laravel new-site
Download xdebug-2.4.0.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.4.0.tgz
Run: cd xdebug-2.4.0
Configuring for:
...
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
If it does not, you are using the wrong phpize. Please follow this FAQ entry
and skip the next step.
Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20151012
Update /etc/php/7.0/fpm/php.ini and change the line
zend_extension = /usr/lib/php/20151012/xdebug.so
Restart the webserver
[08.06.2016. 08.34.45] Nemanja Sokolovic: [xdebug]
zend_extension = /usr/lib/php/20151012/xdebug.so
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_enable = 1
xdebug.idekey = phpstorm
[08.06.2016. 08.34.51] Nemanja Sokolovic: /etc/php/7.0/fpm/php.ini
*)Configuration
-In config folder
-Accessing
1)Folder structure
app - core code aplikacije
app/Http/Controllers - kontroleri
resources/views - view('welcome') = resources/views('welcome.blade.php')
3)Creating controller
kroz comand line - php artisan make:controller PagesController (--plain samo
osnovno)
4)Blade
in app:
|@yield('content')
|@yield('footer')
@extends('app') -> app.blade.php
@section('content')
...
@stop
@section('footer')
<script ...
@stop
<?php moze da se pise u blade
@if @else @endif
@unless if !, @foreach, @foreelse
6)Migrations
database/migrations
kao u zend
Blueprint
php artisan migrate (rollback... php artisan da vidis sta sve postoji )
php artisan (help) make:migration
php artisan make:migration add_excerpt_to_articles_table --table="articles" - nova
migracija npr za dodavanje nove kolone ($table->text('excerpt'))
za drop potreban je dodatni package
7)Eloquent
povezan je sa entitetom iz baze i nasledjuje Model
php artisan make:model Article
php artisan tinker