forked from johnlui/Learn-Laravel-5
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Comment extends Model | ||
{ | ||
// | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-10 col-md-offset-1"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">新增一篇文章</div> | ||
<div class="panel-body"> | ||
|
||
@if (count($errors) > 0) | ||
<div class="alert alert-danger"> | ||
<strong>新增失败</strong> 输入不符合要求<br><br> | ||
{!! implode('<br>', $errors->all()) !!} | ||
</div> | ||
@endif | ||
|
||
<form action="{{ url('admin/article') }}" method="POST"> | ||
{!! csrf_field() !!} | ||
<input type="text" name="title" class="form-control" required="required" placeholder="请输入标题"> | ||
<br> | ||
<textarea name="body" rows="10" class="form-control" required="required" placeholder="请输入内容"></textarea> | ||
<br> | ||
<button class="btn btn-lg btn-info">新增文章</button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-10 col-md-offset-1"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">编辑文章</div> | ||
<div class="panel-body"> | ||
|
||
@if (count($errors) > 0) | ||
<div class="alert alert-danger"> | ||
<strong>编辑失败</strong> 输入不符合要求<br><br> | ||
{!! implode('<br>', $errors->all()) !!} | ||
</div> | ||
@endif | ||
|
||
<form action="{{ url('admin/article/'.$article->id) }}" method="POST"> | ||
{{ method_field('PATCH') }} | ||
{{ csrf_field() }} | ||
<input type="text" name="title" class="form-control" required="required" placeholder="请输入标题" value="{{ $article->title }}"> | ||
<br> | ||
<textarea name="body" rows="10" class="form-control" required="required" placeholder="请输入内容">{{ $article->body }}</textarea> | ||
<br> | ||
<button class="btn btn-lg btn-info">提交修改</button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
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