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
#topSpace{ | |
margin-bottom: 8%; | |
} | |
.form-section { | |
/*padding-left: 15px;*/ | |
/*border-left: 2px solid #FF851B;*/ | |
display: none; | |
} |
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="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content="Multi step/part form designed using bootstrap 4 for responsive and mobile first. This form also includes parseley validation." | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.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
@extends('layouts.app') | |
@section('title', 'Welcome, here is a list of posts') | |
@section('content') | |
<div class="col-sm-12"> | |
<ul> | |
@if($collection) | |
@foreach ($collection->chunk(3) as $items) | |
<div class="row row-seperator"> |
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 | |
namespace App\Http\Requests; | |
use Illuminate\Foundation\Http\FormRequest; | |
class StoreBlogPostRequest extends FormRequest { | |
/** | |
* Determine if the user is authorized to make this request. |
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 | |
namespace App\Http\Requests; | |
use Illuminate\Foundation\Http\FormRequest; | |
class UpdateBlogPostRequest extends FormRequest { | |
/** | |
* Determine if the user is authorized to make this request. | |
* |
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 store(StoreBlogPostRequest $request) {//type hint the store function | |
//check if the user it authenticated | |
if (Auth::check()) { | |
//create a new post | |
$post = new Post; | |
//save the post | |
$post->title = title_case($request->title); | |
$post->description = $request->description; | |
$post->content = $request->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
public function update(UpdateBlogPostRequest $request, Post $post) { | |
//update post | |
DB::table('posts') | |
->where('id', $post->id) | |
->update([ | |
'title' => $request->input('title'), | |
'description' => $request->input('description'), | |
'content' => $request->input('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
/*Small devices (landscape phones, 576px and up)*/ | |
@media (min-width: 576px) { | |
/*card colums setup 2 columns for mobile on landscape view*/ | |
.card-columns{ | |
column-count: 2; |