Skip to content

Instantly share code, notes, and snippets.

View YavorK's full-sized avatar
🥥

Yavor Kirov YavorK

🥥
  • Varna, Bulgaria
View GitHub Profile
@YavorK
YavorK / debug.php
Created August 31, 2016 13:46 — forked from eddieajau/debug.php
Printing a clean debug backtrace in PHP.
// PHP < 5.3.6
foreach (debug_backtrace() as $trace)
{
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']);
}
die;
// PHP >= 5.3.6
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
die;
@YavorK
YavorK / _messages.blade.php
Last active August 7, 2024 21:30
Laravel handle-all-flash-messages partial-view
@if ($errors->any())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
{!! $error !!}<br/>
@endforeach
</div>
@endif
@if (Session::get('flash_success'))
<div class="alert alert-success">
@if(is_array(Session::get('flash_success')))
Controllers:
- File and Folder Structure:
App/Http/Controllers
/Backend/
AdminController.php
WorkplaceController.php
WorkplaceDeliveryController.php
...
/Frontend/
...
# encoding: UTF-8
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
# To use the locales, use `I18n.t`:
# I18n.t 'hello'
# In views, this is aliased to just `t`:
# <%= t('hello') %>
# To use a different locale, set it with `I18n.locale`:
# I18n.locale = :es