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 | |
class DataModel{ | |
// Hold an instance of the class | |
private static $instance; | |
private $data; | |
private function __construct() { | |
$this->data = array(); | |
} |
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
<!DOCTYPE html> | |
<html lang="{{ config('app.locale') }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="robots" content="none" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui"> | |
<meta name="description" content="admin login"> | |
<title>Admin - {{ Voyager::setting("admin.title") }}</title> | |
<link rel="stylesheet" href="{{ voyager_asset('css/app.css') }}"> |
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 buildSchema() { | |
$sanJose = Schema::place() | |
->name('First Security Services') | |
->alternateName('Santa Clara County Office') | |
->additionalType('LocalBusiness') | |
->sameAs([ | |
'https://plus.google.com/118059828266473072030/', |
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 | |
//Your Model | |
protected $appends = [ | |
'vue_props', | |
]; | |
//Props Ancestor Attribute | |
public function getVuePropsAttribute(){ | |
$props = (object) array(); |
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 | |
use \Illuminate\Support\Collection; | |
Collection::macro('recursive', function () { | |
return $this->map(function ($value) { | |
if (is_array($value)) { | |
return collect($value)->recursive(); | |
} | |
return $value; | |
}); |
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 //Model | |
/** | |
* Set Logo Attribute | |
* @return void | |
*/ | |
function setLogoAttribute($value){ | |
//Delete current file | |
if(!is_null($this->attributes['logo']) || is_null($value)){ |
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 | |
//Your Model | |
public function setUploadsAttribute($value){ | |
foreach($value as $fileUpload){ | |
if($fileUpload->isValid()){ | |
$name = str_slug(str_replace('.'.$fileUpload->getClientOriginalExtension(), '', $fileUpload->getClientOriginalName())).'.'.$fileUpload->guessClientExtension(); | |
$file = [ | |
'name' => $name, |
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
Vue.component('google-autocomplete', { | |
props: [], | |
data: function() { | |
return { | |
autoComplete: null, | |
place: {} | |
} | |
}, | |
template:'<input ref="autoComplete" placeholder="Type address..." type="text" class="form-control" v-on:keydown="keyDown"/>', | |
mounted: function() { |
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
//Replace Shortcode | |
$replacement = "[av_textblock size='' font_color='' color=''] Scroll down to view listings from ".$serviceName." in ".$city.", ".$state.". [/av_textblock]"; | |
$post->post_content = preg_replace('%\[av_textblock size=\'[^"]*\' font_color=\'[^"]*\' color=\'[^"]*\']([^[]*)\[/av_textblock]%', $replacement, $post->post_content); |
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
<stript> | |
/** Import Element UI **/ | |
import ElementUI from 'element-ui'; | |
import locale from 'element-ui/lib/locale/lang/en'; | |
Vue.use(ElementUI, { locale }); | |
/** Init App **/ | |
window.app = new Vue({ | |
el: '#app', | |
data() { |