Skip to content

Instantly share code, notes, and snippets.

View lawdoc71's full-sized avatar
🎯
Focusing

Michael lawdoc71

🎯
Focusing
View GitHub Profile
@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;
}
@lawdoc71
lawdoc71 / carousel.partial
Created October 9, 2018 18:03 — forked from evercode1/carousel.partial
chapter 10 carousel 1st
@lawdoc71
lawdoc71 / dropdown nav
Created October 9, 2018 18:01 — forked from evercode1/dropdown nav
chapter 10 dropdown nav
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
Content <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/widget">Widgets</a></li>
@if (Auth::check() && Auth::user()->isAdmin())
<li><a href="/marketing-image">Marketing Images</a></li>
@endif
</ul>
@lawdoc71
lawdoc71 / index.blade.php
Created October 9, 2018 17:59 — forked from evercode1/index.blade.php
Chapter 10 MarketingImage index.blade.php
@extends('layouts.master')
@section('title')
<title>Marketing Images</title>
@endsection
@section('content')
@lawdoc71
lawdoc71 / EditImageRequest.php
Created October 9, 2018 17:50 — forked from evercode1/EditImageRequest.php
chapter 10 EditImageRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class EditImageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@lawdoc71
lawdoc71 / edit.blade.php
Created October 9, 2018 17:45 — forked from evercode1/edit.blade.php
Chapter 10 5.2 edit.blade.php
@extends('layouts.master')
@section('title')
<title>Edit a Marketing Image</title>
@endsection
@section('content')
@lawdoc71
lawdoc71 / show.blade.php
Created October 9, 2018 17:41 — forked from evercode1/show.blade.php
Chapter 10 MarketingImage show.blade.php
@extends('layouts.master')
@section('title')
<title>{{ $marketingImage->name }}</title>
@endsection
@section('content')
@lawdoc71
lawdoc71 / ShowsImages.php
Created October 9, 2018 17:36 — forked from evercode1/ShowsImages.php
Chapter 10 ShowsImages trait
<?php
namespace App\Traits;
trait ShowsImages
{
public function noCache()
{
@lawdoc71
lawdoc71 / accessors
Created October 9, 2018 17:34 — forked from evercode1/accessors
chapter 10 Marketing Image Accessors
public function showActiveStatus($is_active)
{
return $is_active == 1 ? 'Yes' : 'No';
}
public function showFeaturedStatus($is_featured)
{