Skip to content

Instantly share code, notes, and snippets.

@evercode1
evercode1 / create.blade.php
Last active February 12, 2017 22:24
chapter 15 lesson/create.blade.php revised
@extends('layouts.master')
@section('title')
<title>Create a Lesson</title>
@endsection
@section('content')
@evercode1
evercode1 / show.blade.php
Created February 12, 2017 21:42
cahpter 15 lesson/show.blade.php revised
@extends('layouts.master')
@section('title')
<title>{{ $lesson->name }} Lesson</title>
@endsection
@section('content')
@evercode1
evercode1 / LessonGrid.vue
Created February 12, 2017 21:22
cahpter 15 LessonGrid.vue revised
<template>
<div class="row">
<div class="col-lg-12">
<form id="search">
Search <input name="query" v-model="query" @keyup="search(query)">
</form>
<div class="pull-right">
{{ total }} Total Results
</div>
<section class="panel">
@evercode1
evercode1 / LessonQuery.php
Created February 12, 2017 21:05
chapter 15 LessonQuery.php revised
<?php
namespace App\Queries\GridQueries;
use DB;
use App\Queries\GridQueries\Contracts\DataQuery;
class LessonQuery implements DataQuery
{
public function data($column, $direction)
@evercode1
evercode1 / LessonController.php
Created February 12, 2017 20:41
chapter 15 Lesson Controller store method
public function store(LessonCreateRequest $request)
{
$slug = str_slug($request->name, "-");
$widget = Lesson::create(['name' => $request->name,
'slug' => $slug,
'category_id' => $request->category_id,
'subcategory_id' => $request->subcategory_id]);
@evercode1
evercode1 / web.php
Created February 12, 2017 19:42
chapter 15 web.php with lesson routes
<?php
use App\Events\MessagePosted;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
@evercode1
evercode1 / ValidatorServiceProvider.php
Created February 12, 2017 19:21
chapter 15 ValidationServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Subcategory;
use App\Category;
class ValidatorServiceProvider extends ServiceProvider
@evercode1
evercode1 / ValidatorServiceProvider.php
Created February 12, 2017 18:37
chapter 15 ValidatorServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Subcategory;
class ValidatorServiceProvider extends ServiceProvider
{
@evercode1
evercode1 / LessonCreateRequest.php
Created February 12, 2017 00:53
chapter 15 LessonCreateRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use App\Category;
use App\Subcategory;
use Illuminate\Validation\Factory as ValidationFactory;
@evercode1
evercode1 / LessonController.php
Last active February 12, 2017 21:39
chapter 15 LessonController.php
<?php
namespace App\Http\Controllers;
use App\Http\AuthTraits\OwnsRecord;
use Illuminate\Http\Request;
use App\Lesson;
use App\Category;
use App\Subcategory;
use Redirect;