29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Helper Functions 273<br />

.<br />

1 $array = [100, 200, 300];<br />

2<br />

3 $last = last($array);<br />

4<br />

5 // 300<br />

Paths<br />

app_path() {#collection-method}<br />

The app_path function returns the fully qualified path to the app directory:<br />

.<br />

1 $path = app_path();<br />

You may also use the app_path function to generate a fully qualified path to a given file relative to<br />

the application directory:<br />

.<br />

1 $path = app_path('Http/Controllers/Controller.php');<br />

base_path() {#collection-method}<br />

The base_path function returns the fully qualified path to the project root:<br />

.<br />

1 $path = base_path();<br />

You may also use the base_path function to generate a fully qualified path to a given file relative to<br />

the application directory:<br />

.<br />

1 $path = base_path('vendor/bin');

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!