This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro alerts() %} | |
{% set types = ['success', 'error', 'info', 'warning'] %} | |
{% for type in types %} | |
{% if( old(type) ) %} | |
<p class="alert alert-{% if type == 'error' %}danger{% else %}{{type}}{% endif %}">{{ old(type) }}</p> | |
{% endif %} | |
{% endfor %} | |
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function requestRescrape($url) | |
{ | |
$graphUrl = 'https://graph.facebook.com/'; | |
$post = 'id=' . urlencode($url) . '&scrape=true'; | |
\Httpful\Request::post($graphUrl)->body($post)->send(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Alfanso\Services\Jvzoo; | |
class Jvzoo { | |
public function isValidRequest($data) { | |
$jvzooSecretKey = config('jvzoo.secret_key'); | |
$receivedVerificationCode = $data['cverify']; | |
// remove cverify from the array since we don't use that | |
unset($data['cverify']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Link to Back page | |
*/ | |
HTML::macro("link_to_back", function($text = "Back"){ | |
return "<a href='javascript:history.back();'>$text</a>"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Display Error / Success / Warn / Info messages | |
* | |
* These messages are set using Session::flash(<message_type>, <message>); | |
*/ | |
HTML::macro("alert", function(){ | |
$alerts = array(); | |
$alert_types = array("error", "success", "warn", "info"); | |
foreach ($alert_types as $type) { | |
if( Session::has($type) ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Open form for a Route | |
*/ | |
Form::macro('open_by_route', function($route, $params = array(), $attributes = array(), $type = "POST"){ | |
return Form::open( URL::to_route( $route, $params ), $type, $attributes ); | |
}); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns first error message for a field, if any, in html | |
*/ | |
Form::macro('first_field_error', function($field_name){ | |
$html = array(); | |
$errors = Session::get('errors'); | |
if( $errors->has( $field_name ) ){ | |
array_push( $html, '<div class="form-error">' ); | |
array_push( $html, $errors->first( $field_name ) ); |