Skip to content

Instantly share code, notes, and snippets.

@webinfinita
webinfinita / session-messages.blade
Last active September 16, 2015 05:02
Check and display session messages for Laravel 5 with AdminLTE styles
@if(session()->has('success_message'))
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Excelente!</h4>
{{ session()->get('success_message') }}
</div>
@endif
@if(session()->has('info_message'))
<div class="alert alert-info alert-dismissable">
@webinfinita
webinfinita / filters.php
Created October 29, 2014 01:59
Filters for API's
App::before(function($request)
{
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, X-Request-With');
header('Access-Control-Allow-Credentials: true');
});
@webinfinita
webinfinita / setTitleSlug
Last active August 29, 2015 14:02
Create Slug of given title on save
public function setTitleAttribute($title)
{
$this->attributes['title'] = $title;
$this->attributes['slug'] = Str::slug($title);
}
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" >
@webinfinita
webinfinita / bootstrap-breakpoints.sass
Last active February 27, 2024 17:23
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
<div class="fb-comments"data-href="<?php the_permalink(); ?>" data-num-posts="2" mobile="false"></div>