Skip to content

Instantly share code, notes, and snippets.

View lawdoc71's full-sized avatar
🎯
Focusing

Michael lawdoc71

🎯
Focusing
View GitHub Profile
@lawdoc71
lawdoc71 / SvgIcon.vue
Created February 20, 2019 07:24 — forked from calebporzio/SvgIcon.vue
SVG Icon Vue Component
<template>
<div class="inline-block" v-html="require('icon-' + this.icon + '.svg')"></div>
</template>
<style module>
.svg {
fill: currentColor;
height: 1em;
margin-top: -4px;
vertical-align: middle;
@lawdoc71
lawdoc71 / index.blade.php
Created October 9, 2018 18:29 — forked from evercode1/index.blade.php
Chapter 10 table MarketingImage index.blade.php
<table class="table table-hover table-bordered table-striped">
<thead>
<th>Thumbnail</th>
<th>Name</th>
<th>Weight</th>
<th>Featured</th>
<th>Active</th>
<th>Date Created</th>
</thead>
@lawdoc71
lawdoc71 / grid.blade.php
Created October 9, 2018 18:27 — forked from evercode1/grid.blade.php
chapter 10 grid.blade.php
<div class="row">
<div class="col-xs-6 col-lg-4">
<a href="/user"><h2>Users</h2></a>
<a href="/user"><p>Use this link to manage your applications's users</p></a>
<p><a class="btn btn-default" href="/user" role="button">View details &raquo;</a></p>
</div><!--/.col-xs-6.col-lg-4-->
<div class="col-xs-6 col-lg-4">
<a href="/profile"><h2>Profiles</h2></a>
<a href="/profile"><p>Use this link to manage your applications's profiles</p></a>
<p><a class="btn btn-default" href="/profile" role="button">View details &raquo;</a></p>
@lawdoc71
lawdoc71 / show.blade.php
Created October 9, 2018 18:25 — forked from evercode1/show.blade.php
Chapter 10 show.blade.php with image_weight
@extends('layouts.master')
@section('title')
<title>{{ $marketingImage->name }}</title>
@endsection
@section('content')
@lawdoc71
lawdoc71 / create.blade.php
Created October 9, 2018 18:21 — forked from evercode1/create.blade.php
Chapter 10 create.blade.php image_weight
<!-- image_weight Form Input -->
<div class="form-group{{ $errors->has('image_weight') ? ' has-error' : '' }}">
<label class="control-label">Image Weight</label>
<input type="number" class="form-control" name="image_weight" value="{{ old('image_weight') ? old('image_weight') : 100 }}">
@if ($errors->has('image_weight'))
@lawdoc71
lawdoc71 / MarketingImageController.php
Created October 9, 2018 18:20 — forked from evercode1/MarketingImageController.php
chapter 10 MarketingImageController.php
<?php
namespace App\Http\Controllers;
use App\Traits\ManagesImages;
use App\Http\Requests\CreateImageRequest;
use App\MarketingImage;
use App\Http\Requests\EditImageRequest;
class MarketingImageController extends Controller
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddImageWeightToMarketingImagesTable extends Migration
{
/**
* Run the migrations.
@lawdoc71
lawdoc71 / slider.blade.php
Created October 9, 2018 18:11 — forked from evercode1/slider.blade.php
Chapter 10 Revised slider.blade.php
<div>
<div>
@if ($notEnoughImages)
Not enough images in slider. Populate images or remove slider include from pages.index.
@else
<div id="carousel-marketing-images" class="carousel slide" data-ride="carousel" data-interval="false">
@lawdoc71
lawdoc71 / PagesController.php
Created October 9, 2018 18:09 — forked from evercode1/PagesController.php
Chapter 10 PagesController index method
public function index()
{
$featuredImage = MarketingImage::where('is_featured', 1)
->where('is_active', 1)
->first();
$activeImages = MarketingImage::where('is_featured', 0)
->where('is_active', 1)
->get();
@lawdoc71
lawdoc71 / ShowsImages.php
Created October 9, 2018 18:07 — forked from evercode1/ShowsImages.php
chapter 10 notEnoughSliderImages mehtod
private function notEnoughSliderImages($featuredImage, $activeImages)
{
return (!count($featuredImage) || !count($activeImages) >= 1) ? true : false;
}