├── .env.example ├── .gitattributes ├── .gitignore ├── LICENSE ├── app ├── Article.php ├── Category.php ├── Commands │ └── Command.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── Handlers │ ├── Commands │ │ └── .gitkeep │ └── Events │ │ └── .gitkeep ├── Helpers │ └── helpers.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── AdminController.php │ │ │ ├── ArticlesController.php │ │ │ ├── AuthController.php │ │ │ ├── CategoriesController.php │ │ │ ├── SettingsController.php │ │ │ └── TagsController.php │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── Controller.php │ │ ├── Home │ │ │ ├── ArticlesController.php │ │ │ ├── CategoriesController.php │ │ │ ├── HomeController.php │ │ │ └── TagsController.php │ │ └── WelcomeController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ ├── ArticleRequest.php │ │ ├── CategoryRequest.php │ │ ├── Request.php │ │ ├── SettingRequest.php │ │ └── TagRequest.php │ └── routes.php ├── Providers │ ├── AppServiceProvider.php │ ├── BusServiceProvider.php │ ├── ConfigServiceProvider.php │ ├── EventServiceProvider.php │ ├── RouteServiceProvider.php │ └── ViewComposerServiceProvider.php ├── Services │ └── Registrar.php ├── Setting.php ├── Tag.php └── User.php ├── artisan ├── bootstrap ├── app.php └── autoload.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── compile.php ├── database.php ├── debugbar.php ├── filesystems.php ├── htmlmin.php ├── mail.php ├── queue.php ├── services.php ├── session.php ├── sitemap.php └── view.php ├── database ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2015_02_13_122151_create_categories_table.php │ ├── 2015_02_13_142235_create_articles_table.php │ ├── 2015_02_13_155726_create_tags_table.php │ └── 2015_02_22_054359_create_settings_table.php └── seeds │ ├── .gitkeep │ ├── ArticlesTableSeeder.php │ ├── CategoriesTableSeeder.php │ ├── DatabaseSeeder.php │ ├── SettingsTableSeeder.php │ ├── TagsTableSeeder.php │ └── UsersTableSeeder.php ├── gulpfile.js ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .gitignore ├── .htaccess ├── admin-assets │ ├── css │ │ ├── bootstrap.min.css │ │ ├── codemirror.css │ │ ├── font-awesome.min.css │ │ ├── metisMenu.min.css │ │ ├── sb-admin-2.css │ │ └── select2.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── bootstrap.min.js │ │ ├── codemirror.js │ │ ├── continuelist.js │ │ ├── inline-attachment.js │ │ ├── jquery.inline-attachment.js │ │ ├── jquery.min.js │ │ ├── markdown.js │ │ ├── metisMenu.min.js │ │ ├── sb-admin-2.js │ │ └── select2.min.js ├── build │ ├── css │ │ └── all-71c0cf33.css │ ├── js │ │ └── all-3c7b3210.js │ └── rev-manifest.json ├── css │ └── all.css ├── favicon.ico ├── index.php ├── js │ └── all.js ├── robots.txt └── uploads │ └── images │ └── .gitignore ├── readme.md ├── resources ├── css │ ├── bootstrap.min.css │ ├── highlight-default.css │ └── home.css ├── js │ ├── bootstrap.min.js │ ├── highlight.js │ └── jquery.min.js ├── lang │ └── en │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── aaa.blade.php │ ├── admin │ ├── articles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── form.blade.php │ │ ├── index.blade.php │ │ └── trash.blade.php │ ├── categories │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── form.blade.php │ │ └── index.blade.php │ ├── index.blade.php │ ├── layout.blade.php │ ├── login.blade.php │ ├── partials │ │ ├── footer.blade.php │ │ ├── header.blade.php │ │ ├── navbar.blade.php │ │ └── sidebar.blade.php │ ├── settings │ │ ├── form.blade.php │ │ └── index.blade.php │ ├── tags │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── form.blade.php │ │ └── index.blade.php │ └── users │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── form.blade.php │ │ └── index.blade.php │ ├── auth │ ├── login.blade.php │ ├── password.blade.php │ ├── register.blade.php │ └── reset.blade.php │ ├── emails │ └── password.blade.php │ ├── errors │ ├── 503.blade.php │ └── list.blade.php │ ├── home │ ├── articles │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── categories │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── index.blade.php │ ├── layout.blade.php │ ├── partials │ │ ├── flash.blade.php │ │ ├── nav.blade.php │ │ └── sidebar.blade.php │ └── tags │ │ ├── index.blade.php │ │ └── show.blade.php │ └── vendor │ ├── .gitkeep │ ├── flash │ ├── message.blade.php │ └── modal.blade.php │ └── sitemap │ ├── html.blade.php │ ├── ror-rdf.blade.php │ ├── ror-rss.blade.php │ ├── sitemapindex.blade.php │ ├── txt.blade.php │ └── xml.blade.php ├── server.php ├── storage ├── .gitignore ├── app │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ExampleTest.php └── TestCase.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY=SomeRandomString 4 | 5 | DB_HOST=localhost 6 | DB_DATABASE=homestead 7 | DB_USERNAME=homestead 8 | DB_PASSWORD=secret 9 | 10 | CACHE_DRIVER=redis 11 | SESSION_DRIVER=redis 12 | 13 | APP_URL=http://localhost 14 | APP_TIMEZONE=UTC 15 | APP_LOCAL=en -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | /bower_components 4 | .env 5 | cmds.bat -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 林大帅 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /app/Article.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 20 | } 21 | 22 | public function tags() 23 | { 24 | return $this->belongsToMany('App\Tag'); 25 | } 26 | 27 | public function category() 28 | { 29 | return $this->belongsTo('App\Category'); 30 | } 31 | 32 | public function getTagListAttribute() 33 | { 34 | return $this->tags->lists('id'); 35 | } 36 | 37 | public function getBodyHtmlAttribute() 38 | { 39 | $Parsedown = new \Parsedown(); 40 | 41 | return $Parsedown->text($this->body); 42 | } 43 | 44 | public function setCreatedAtAttribute($date) 45 | { 46 | if (is_string($date)) { 47 | $this->attributes['created_at'] = Carbon::createFromFormat('Y-m-d', $date); 48 | } else { 49 | $this->attributes['created_at'] = $date; 50 | } 51 | } 52 | 53 | public function setSlugAttribute($data) 54 | { 55 | $this->attributes['slug'] = str_slug($data); 56 | } 57 | 58 | public function scopeFindBySlug($query, $slug) 59 | { 60 | return $query->whereSlug($slug)->firstOrFail(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Category.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Article'); 12 | } 13 | 14 | public function setSlugAttribute($data) 15 | { 16 | $this->attributes['slug'] = str_slug($data); 17 | } 18 | 19 | public function scopeGetTopLevel($query) 20 | { 21 | return $query->where('parent_id', 0)->get(); 22 | } 23 | 24 | public function scopeFindBySlug($query, $slug) 25 | { 26 | return $query->whereSlug($slug)->firstOrFail(); 27 | } 28 | 29 | public static function getLeveledCategories() 30 | { 31 | return \Cache::tags('categories')->rememberForever('leveled_categories', function () { 32 | $categories = Category::all(); 33 | $result = array(); 34 | foreach ($categories as $category) { 35 | if ($category->parent_id == 0) { 36 | $result['top'][] = $category; 37 | foreach ($categories as $scategory) { 38 | if ($scategory->parent_id == $category->id) { 39 | $result['second'][$category->id][] = $scategory; 40 | } 41 | } 42 | } 43 | } 44 | 45 | return $result; 46 | }); 47 | } 48 | 49 | public static function getSortedCategories() 50 | { 51 | return \Cache::tags('categories')->rememberForever('sorted_categories', function () { 52 | $categories = Category::all(); 53 | $result = array(); 54 | foreach ($categories as $category) { 55 | if ($category->parent_id == 0) { 56 | $result[] = $category; 57 | foreach ($categories as $scategory) { 58 | if ($scategory->parent_id == $category->id) { 59 | $result[] = $scategory; 60 | } 61 | } 62 | } 63 | } 64 | 65 | return $result; 66 | }); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Commands/Command.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 25 | ->hourly(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 13 | } 14 | 15 | /** 16 | * Show the application dashboard to the user. 17 | * 18 | * @return Response 19 | */ 20 | public function index() 21 | { 22 | return view('admin.index'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/ArticlesController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 12 | } 13 | 14 | /** 15 | * Display a listing of the resource. 16 | * 17 | * @return Response 18 | */ 19 | public function index() 20 | { 21 | $articles = Article::with('tags', 'category')->latest()->paginate(15); 22 | 23 | return view('admin.articles.index', compact('articles')); 24 | } 25 | 26 | /** 27 | * Show the form for creating a new resource. 28 | * 29 | * @return Response 30 | */ 31 | public function create() 32 | { 33 | $tags = \App\Tag::lists('name', 'id'); 34 | 35 | $categories = \App\Category::getLeveledCategories(); 36 | 37 | return view('admin.articles.create', compact('tags', 'categories')); 38 | } 39 | 40 | /** 41 | * Store a newly created resource in storage. 42 | * 43 | * @return Response 44 | */ 45 | public function store(ArticleRequest $request) 46 | { 47 | $this->createArticle($request); 48 | 49 | flash()->success('Your article has been created!'); 50 | 51 | return redirect('admin/articles/index'); 52 | } 53 | 54 | /** 55 | * Display the specified resource. 56 | * 57 | * @param int $id 58 | * 59 | * @return Response 60 | */ 61 | public function show($slug) 62 | { 63 | $article = Article::findBySlug($slug); 64 | 65 | return view('articles.show', compact('article')); 66 | } 67 | 68 | /** 69 | * Show the form for editing the specified resource. 70 | * 71 | * @param int $id 72 | * 73 | * @return Response 74 | */ 75 | public function edit($id) 76 | { 77 | $article = Article::findOrFail($id); 78 | 79 | $tags = \App\Tag::lists('name', 'id'); 80 | 81 | $categories = \App\Category::getLeveledCategories(); 82 | 83 | return view('admin.articles.edit', compact('article', 'tags', 'categories')); 84 | } 85 | 86 | /** 87 | * Update the specified resource in storage. 88 | * 89 | * @param int $id 90 | * 91 | * @return Response 92 | */ 93 | public function update(ArticleRequest $request, $id) 94 | { 95 | $article = Article::findOrFail($id); 96 | 97 | $article->update($request->all()); 98 | 99 | $this->syncTags($article, $request->input('tag_list')); 100 | 101 | return redirect('admin/articles/index'); 102 | } 103 | 104 | /** 105 | * Remove the specified resource from storage. 106 | * 107 | * @param int $id 108 | * 109 | * @return Response 110 | */ 111 | public function destroy($id) 112 | { 113 | Article::find($id)->delete(); 114 | 115 | return redirect('admin/articles/trash'); 116 | } 117 | 118 | public function trash() 119 | { 120 | $articles = Article::with('tags', 'category')->onlyTrashed()->latest('deleted_at')->paginate(15); 121 | 122 | return view('admin.articles.trash', compact('articles')); 123 | } 124 | 125 | public function restore($id) 126 | { 127 | Article::onlyTrashed()->find($id)->restore(); 128 | 129 | return redirect('admin/articles/index'); 130 | } 131 | 132 | public function forceDelete($id) 133 | { 134 | Article::onlyTrashed()->find($id)->forceDelete(); 135 | 136 | return redirect('admin/articles/trash'); 137 | } 138 | 139 | public function syncTags(Article $article, array $tags) 140 | { 141 | foreach ($tags as $key => $tag) { 142 | if (!is_numeric($tag)) { 143 | $newTag = \App\Tag::create(['name' => $tag, 'slug' => $tag]); 144 | $tags[$key] = $newTag->id; 145 | } 146 | } 147 | 148 | $article->tags()->sync($tags); 149 | } 150 | 151 | public function createArticle(ArticleRequest $request) 152 | { 153 | $article = \Auth::user()->articles()->create($request->all()); 154 | 155 | $this->syncTags($article, $request->input('tag_list')); 156 | } 157 | 158 | public function uploadImage() 159 | { 160 | if ($file = \Request::file('file')) { 161 | $allowed_extensions = ["png", "jpg", "gif"]; 162 | if ($file->getClientOriginalExtension() && !in_array($file->getClientOriginalExtension(), $allowed_extensions)) { 163 | return ['error' => 'You may only upload png, jpg or gif.']; 164 | } 165 | 166 | $fileName = $file->getClientOriginalName(); 167 | $extension = $file->getClientOriginalExtension() ?: 'png'; 168 | $folderName = '/uploads/images/'.date('Y', time()).'/'; 169 | $destinationPath = public_path().$folderName; 170 | $safeName = uniqid().'.'.$extension; 171 | $file->move($destinationPath, $safeName); 172 | 173 | $filePath = $folderName.$safeName; 174 | $cdnPath = cdn($filePath); 175 | 176 | return ['filename' => $cdnPath]; 177 | } else { 178 | return ['error' => 'Error while uploading file']; 179 | } 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/AuthController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 12 | } 13 | 14 | /** 15 | * Show the application login form. 16 | * 17 | * @return \Illuminate\Http\Response 18 | */ 19 | public function getLogin() 20 | { 21 | return view('admin.login'); 22 | } 23 | 24 | /** 25 | * Handle a login request to the application. 26 | * 27 | * @param \Illuminate\Http\Request $request 28 | * 29 | * @return \Illuminate\Http\Response 30 | */ 31 | public function postLogin(Request $request) 32 | { 33 | $credentials = $request->only('email', 'password'); 34 | 35 | if (Auth::attempt($credentials, $request->has('remember'))) { 36 | return redirect()->intended('/admin/index'); 37 | } 38 | 39 | return redirect('/login') 40 | ->withInput($request->only('email', 'remember')) 41 | ->withErrors([ 42 | 'email' => 'These credentials do not match our records.', 43 | ]); 44 | } 45 | 46 | /** 47 | * Log the user out of the application. 48 | * 49 | * @return \Illuminate\Http\Response 50 | */ 51 | public function logout() 52 | { 53 | Auth::logout(); 54 | 55 | return redirect('/'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/CategoriesController.php: -------------------------------------------------------------------------------- 1 | lists('name', 'id'); 29 | 30 | $categories = ['0' => '/'] + $categories; 31 | 32 | return view('admin.categories.create', compact('categories')); 33 | } 34 | 35 | /** 36 | * Store a newly created resource in storage. 37 | * 38 | * @return Response 39 | */ 40 | public function store(CategoryRequest $request) 41 | { 42 | Category::create($request->all()); 43 | 44 | flash()->success('Your category has been created!'); 45 | 46 | \Cache::tags('categories')->flush(); 47 | 48 | return redirect('admin/categories/index'); 49 | } 50 | 51 | /** 52 | * Display the specified resource. 53 | * 54 | * @param int $id 55 | * 56 | * @return Response 57 | */ 58 | public function show($slug) 59 | { 60 | $category = Category::findBySlug($slug); 61 | 62 | return view('categories.show', compact('category')); 63 | } 64 | 65 | /** 66 | * Show the form for editing the specified resource. 67 | * 68 | * @param int $id 69 | * 70 | * @return Response 71 | */ 72 | public function edit($id) 73 | { 74 | $category = Category::findOrFail($id); 75 | 76 | $categories = \App\Category::getTopLevel()->lists('name', 'id'); 77 | 78 | $categories = ['0' => '/'] + $categories; 79 | 80 | return view('admin.categories.edit', compact('category', 'categories')); 81 | } 82 | 83 | /** 84 | * Update the specified resource in storage. 85 | * 86 | * @param int $id 87 | * 88 | * @return Response 89 | */ 90 | public function update(CategoryRequest $request, $id) 91 | { 92 | $category = Category::findOrFail($id); 93 | 94 | $category->update($request->all()); 95 | 96 | \Cache::tags('categories')->flush(); 97 | 98 | return redirect('admin/categories/index'); 99 | } 100 | 101 | /** 102 | * Remove the specified resource from storage. 103 | * 104 | * @param int $id 105 | * 106 | * @return Response 107 | */ 108 | public function destroy($id) 109 | { 110 | Category::find($id)->delete(); 111 | 112 | return redirect('admin/categories/index'); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/SettingsController.php: -------------------------------------------------------------------------------- 1 | all() as $name => $value) { 39 | if ($name != '_method' && $name != '_token') { 40 | $setting = Setting::whereName($name)->first(); 41 | 42 | $setting->update([ 43 | 'value' => $value, 44 | ]); 45 | } 46 | } 47 | 48 | //更新设置缓存 49 | \Cache::forget('settings_array'); 50 | 51 | return redirect('admin/settings/index'); 52 | } 53 | 54 | /** 55 | * Display the specified resource. 56 | * 57 | * @param int $id 58 | * 59 | * @return Response 60 | */ 61 | public function show($id) 62 | { 63 | // 64 | } 65 | 66 | /** 67 | * Show the form for editing the specified resource. 68 | * 69 | * @param int $id 70 | * 71 | * @return Response 72 | */ 73 | public function edit($id) 74 | { 75 | // 76 | } 77 | 78 | /** 79 | * Update the specified resource in storage. 80 | * 81 | * @param int $id 82 | * 83 | * @return Response 84 | */ 85 | public function store($id) 86 | { 87 | // 88 | } 89 | 90 | /** 91 | * Remove the specified resource from storage. 92 | * 93 | * @param int $id 94 | * 95 | * @return Response 96 | */ 97 | public function destroy($id) 98 | { 99 | // 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/TagsController.php: -------------------------------------------------------------------------------- 1 | paginate(15); 17 | 18 | return view('admin.tags.index', compact('tags')); 19 | } 20 | 21 | /** 22 | * Show the form for creating a new resource. 23 | * 24 | * @return Response 25 | */ 26 | public function create() 27 | { 28 | return view('admin.tags.create'); 29 | } 30 | 31 | /** 32 | * Store a newly created resource in storage. 33 | * 34 | * @return Response 35 | */ 36 | public function store(TagRequest $request) 37 | { 38 | Tag::create($request->all()); 39 | 40 | flash()->success('Your tag has been created!'); 41 | 42 | return redirect('admin/tags/index'); 43 | } 44 | 45 | /** 46 | * Display the specified resource. 47 | * 48 | * @param int $id 49 | * 50 | * @return Response 51 | */ 52 | public function show($slug) 53 | { 54 | $tag = Tag::findBySlug($slug); 55 | 56 | return view('tags.show', compact('tag')); 57 | } 58 | 59 | /** 60 | * Show the form for editing the specified resource. 61 | * 62 | * @param int $id 63 | * 64 | * @return Response 65 | */ 66 | public function edit($id) 67 | { 68 | $tag = Tag::findOrFail($id); 69 | 70 | $tags = \App\Tag::lists('name', 'id'); 71 | 72 | return view('admin.tags.edit', compact('tag', 'tags')); 73 | } 74 | 75 | /** 76 | * Update the specified resource in storage. 77 | * 78 | * @param int $id 79 | * 80 | * @return Response 81 | */ 82 | public function update(TagRequest $request, $id) 83 | { 84 | $tag = Tag::findOrFail($id); 85 | 86 | $tag->update($request->all()); 87 | 88 | return redirect('admin/tags/index'); 89 | } 90 | 91 | /** 92 | * Remove the specified resource from storage. 93 | * 94 | * @param int $id 95 | * 96 | * @return Response 97 | */ 98 | public function destroy($id) 99 | { 100 | Tag::find($id)->delete(); 101 | 102 | return redirect('admin/tags/index'); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 34 | $this->registrar = $registrar; 35 | 36 | $this->middleware('guest', ['except' => 'getLogout']); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 32 | $this->passwords = $passwords; 33 | 34 | $this->middleware('guest'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | latest()->paginate($page_size); 18 | 19 | return view('home.articles.index', compact('articles')); 20 | } 21 | 22 | /** 23 | * Display the specified resource. 24 | * 25 | * @param int $id 26 | * 27 | * @return Response 28 | */ 29 | public function show($slug) 30 | { 31 | $article = Article::findBySlug($slug); 32 | 33 | return view('home.articles.show', compact('article')); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/Home/CategoriesController.php: -------------------------------------------------------------------------------- 1 | articles()->latest()->paginate(8); 28 | $page_size = setting('page_size'); 29 | 30 | $category = Category::findBySlug($slug); 31 | 32 | $articles = \App\Article::with('tags', 'category')->whereHas('category', function ($query) use ($slug) { 33 | $query->whereSlug($slug); 34 | })->latest()->paginate($page_size); 35 | 36 | return view('home.categories.show', compact('articles', 'category')); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Home/HomeController.php: -------------------------------------------------------------------------------- 1 | latest()->take($page_size)->get(); 28 | 29 | return view('home.index', compact('articles')); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Controllers/Home/TagsController.php: -------------------------------------------------------------------------------- 1 | articles()->latest('articles.created_at')->paginate(8); 28 | 29 | $page_size = setting('page_size'); 30 | 31 | $tag = Tag::findBySlug($slug); 32 | 33 | $articles = \App\Article::with('tags', 'category')->whereHas('tags', function ($query) use ($slug) { 34 | $query->whereSlug($slug); 35 | })->latest()->paginate($page_size); 36 | 37 | return view('home.tags.show', compact('articles', 'tag')); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/WelcomeController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 22 | } 23 | 24 | /** 25 | * Show the application welcome screen to the user. 26 | * 27 | * @return Response 28 | */ 29 | public function index() 30 | { 31 | return view('welcome'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 'App\Http\Middleware\Authenticate', 28 | 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 29 | 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 23 | } 24 | 25 | /** 26 | * Handle an incoming request. 27 | * 28 | * @param \Illuminate\Http\Request $request 29 | * @param \Closure $next 30 | * 31 | * @return mixed 32 | */ 33 | public function handle($request, Closure $next) 34 | { 35 | if ($this->auth->guest()) { 36 | if ($request->ajax()) { 37 | return response('Unauthorized.', 401); 38 | } else { 39 | return redirect()->guest('login'); 40 | } 41 | } 42 | 43 | return $next($request); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 24 | } 25 | 26 | /** 27 | * Handle an incoming request. 28 | * 29 | * @param \Illuminate\Http\Request $request 30 | * @param \Closure $next 31 | * 32 | * @return mixed 33 | */ 34 | public function handle($request, Closure $next) 35 | { 36 | if ($this->auth->check()) { 37 | return new RedirectResponse(url('/')); 38 | } 39 | 40 | return $next($request); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 'required|min:2', 25 | 'body' => 'required', 26 | 'category_id' => 'required|exists:categories,id', 27 | 'tag_list' => 'required', 28 | 'slug' => 'required|unique:articles,slug,'.$this->segment(3), 29 | 'original' => 'url', 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Requests/CategoryRequest.php: -------------------------------------------------------------------------------- 1 | 'required|min:2', 25 | 'slug' => 'required|unique:categories,slug,'.$this->segment(3), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/Request.php: -------------------------------------------------------------------------------- 1 | 'required|min:2', 25 | 'slug' => 'required|unique:tags,slug,'.$this->segment(3), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | 'admin', 'namespace' => 'Admin', 'middleware' => 'auth'], function () { 18 | Route::get('index', 'AdminController@index'); 19 | 20 | Route::get('articles/index', 'ArticlesController@index'); 21 | Route::get('articles/trash', 'ArticlesController@trash'); 22 | Route::post('articles/restore/{id}', 'ArticlesController@restore'); 23 | Route::delete('articles/forceDelete/{id}', 'ArticlesController@forceDelete'); 24 | Route::resource('articles', 'ArticlesController'); 25 | 26 | Route::get('categories/index', 'CategoriesController@index'); 27 | Route::resource('categories', 'CategoriesController'); 28 | 29 | Route::get('tags/index', 'TagsController@index'); 30 | Route::resource('tags', 'TagsController'); 31 | 32 | Route::get('settings/index', 'SettingsController@index'); 33 | Route::patch('settings/index', 'SettingsController@update'); 34 | 35 | Route::post('uploadImage', 'ArticlesController@uploadImage'); 36 | 37 | Route::get('setting/flush', function () { 38 | \Cache::flush(); 39 | 40 | return 'cache flush ok'; 41 | }); 42 | }); 43 | 44 | /* 45 | * auth 46 | */ 47 | Route::get('login', 'Admin\AuthController@getLogin'); 48 | Route::post('login', 'Admin\AuthController@postLogin'); 49 | Route::get('logout', 'Admin\AuthController@logout'); 50 | 51 | /*Route::controllers([ 52 | 'auth' => 'Auth\AuthController', 53 | 'password' => 'Auth\PasswordController', 54 | ]); 55 | */ 56 | 57 | Route::get('foo', function () { 58 | \Cache::flush(); 59 | 60 | return 'ok'; 61 | }); 62 | 63 | Route::get('bar', function () { 64 | 65 | return view('aaa'); 66 | 67 | }); 68 | 69 | /* 70 | * home 71 | */ 72 | Route::group(['namespace' => 'Home'], function () { 73 | 74 | Route::resource('/', 'HomeController@index'); 75 | 76 | Route::get('tags', 'TagsController@index'); 77 | Route::get('tags/{slug}', 'TagsController@show'); 78 | 79 | Route::get('categories', 'CategoriesController@index'); 80 | Route::get('categories/{slug}', 'CategoriesController@show'); 81 | 82 | Route::get('articles', 'ArticlesController@index'); 83 | Route::get('{slug}', 'ArticlesController@show'); 84 | }); 85 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind( 25 | 'Illuminate\Contracts\Auth\Registrar', 26 | 'App\Services\Registrar' 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Providers/BusServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapUsing(function ($command) { 16 | return Dispatcher::simpleMapping( 17 | $command, 'App\Commands', 'App\Handlers\Commands' 18 | ); 19 | }); 20 | } 21 | 22 | /** 23 | * Register any application services. 24 | */ 25 | public function register() 26 | { 27 | // 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Providers/ConfigServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'EventListener', 16 | ], 17 | ]; 18 | 19 | /** 20 | * Register any other events for your application. 21 | * 22 | * @param \Illuminate\Contracts\Events\Dispatcher $events 23 | */ 24 | public function boot(DispatcherContract $events) 25 | { 26 | parent::boot($events); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | group(['namespace' => $this->namespace], function ($router) { 35 | require app_path('Http/routes.php'); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Providers/ViewComposerServiceProvider.php: -------------------------------------------------------------------------------- 1 | composeSidebar(); 13 | //$this->composeSettings(); 14 | } 15 | 16 | /** 17 | * Register the application services. 18 | */ 19 | public function register() 20 | { 21 | // 22 | } 23 | 24 | private function composeSidebar() 25 | { 26 | view()->composer('home.partials.sidebar', function ($view) { 27 | 28 | $allTags = \App\Tag::all(); 29 | $allCategories = \App\Category::getSortedCategories(); 30 | $NewestArticles = \App\Article::latest()->take(15)->get(); 31 | $hottestArticles = \App\Article::orderBy('click')->take(15)->get(); 32 | 33 | $view->with(compact('allTags', 'allCategories', 'NewestArticles', 'hottestArticles')); 34 | }); 35 | } 36 | 37 | //暂时不用,改成使用helpers获取设置值 38 | /*private function composeSettings() 39 | { 40 | view()->composer('*',function($view){ 41 | $settings=\App\Setting::getSettingsArr(); 42 | $view->with(compact('settings')); 43 | 44 | }); 45 | }*/ 46 | } 47 | -------------------------------------------------------------------------------- /app/Services/Registrar.php: -------------------------------------------------------------------------------- 1 | 'required|max:255', 20 | 'email' => 'required|email|max:255|unique:users', 21 | 'password' => 'required|confirmed|min:5', 22 | ]); 23 | } 24 | 25 | /** 26 | * Create a new user instance after a valid registration. 27 | * 28 | * @param array $data 29 | * 30 | * @return User 31 | */ 32 | public function create(array $data) 33 | { 34 | return User::create([ 35 | 'username' => $data['username'], 36 | 'email' => $data['email'], 37 | 'password' => bcrypt($data['password']), 38 | ]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Setting.php: -------------------------------------------------------------------------------- 1 | name]=$setting->value; 18 | }*/ 19 | $settings = \App\Setting::all()->lists('value', 'name'); 20 | 21 | return $settings; 22 | }); 23 | } 24 | 25 | public static function getSettingValue($name) 26 | { 27 | /*return \Cache::remember('setting_'.$name.'_value',1 , function() use($name) 28 | { 29 | $setting=\App\Setting::whereName($name)->first(); 30 | 31 | return $setting->value; 32 | });*/ 33 | 34 | $settings = self::getSettingsArr(); 35 | 36 | return $settings[$name]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Tag.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Article'); 12 | } 13 | 14 | public function setSlugAttribute($data) 15 | { 16 | if (str_slug($data) != '') { 17 | $this->attributes['slug'] = str_slug($data); 18 | } else { 19 | $this->attributes['slug'] = $data; 20 | } 21 | } 22 | 23 | public function scopeFindBySlug($query, $slug) 24 | { 25 | return $query->whereSlug($slug)->firstOrFail(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Article'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make('Illuminate\Contracts\Console\Kernel'); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | 'Illuminate\Contracts\Http\Kernel', 31 | 'App\Http\Kernel' 32 | ); 33 | 34 | $app->singleton( 35 | 'Illuminate\Contracts\Console\Kernel', 36 | 'App\Console\Kernel' 37 | ); 38 | 39 | $app->singleton( 40 | 'Illuminate\Contracts\Debug\ExceptionHandler', 41 | 'App\Exceptions\Handler' 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'App\User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reset Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the options for resetting passwords including the view 52 | | that is your password reset e-mail. You can also set the name of the 53 | | table that maintains all of the reset tokens for your application. 54 | | 55 | | The expire time is the number of minutes that the reset token should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'password' => [ 62 | 'email' => 'emails.password', 63 | 'table' => 'password_resets', 64 | 'expire' => 60, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Cache Stores 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the cache "stores" for your application as 24 | | well as their drivers. You may even define multiple stores for the 25 | | same cache driver to group types of items stored in your caches. 26 | | 27 | */ 28 | 29 | 'stores' => [ 30 | 31 | 'apc' => [ 32 | 'driver' => 'apc' 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array' 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path().'/framework/cache', 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'servers' => [ 53 | [ 54 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100 55 | ], 56 | ], 57 | ], 58 | 59 | 'redis' => [ 60 | 'driver' => 'redis', 61 | 'connection' => 'default', 62 | ], 63 | 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Cache Key Prefix 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When utilizing a RAM based store such as APC or Memcached, there might 72 | | be other applications utilizing the same cache. So, we'll specify a 73 | | value to get prefixed to all our keys so we can avoid collisions. 74 | | 75 | */ 76 | 77 | 'prefix' => 'laravel', 78 | 79 | ]; 80 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | 18 | realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'), 19 | realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'), 20 | realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'), 21 | realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'), 22 | realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'), 23 | 24 | ], 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Compiled File Providers 29 | |-------------------------------------------------------------------------- 30 | | 31 | | Here you may list service providers which define a "compiles" function 32 | | that returns additional files that should be compiled, providing an 33 | | easy way to get common files from any packages you are utilizing. 34 | | 35 | */ 36 | 37 | 'providers' => [ 38 | // 39 | ], 40 | 41 | ]; 42 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => [ 48 | 49 | 'sqlite' => [ 50 | 'driver' => 'sqlite', 51 | 'database' => storage_path() . '/database.sqlite', 52 | 'prefix' => '', 53 | ], 54 | 55 | 'mysql' => [ 56 | 'driver' => 'mysql', 57 | 'host' => env('DB_HOST', 'localhost'), 58 | 'database' => env('DB_DATABASE', 'forge'), 59 | 'username' => env('DB_USERNAME', 'forge'), 60 | 'password' => env('DB_PASSWORD', ''), 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => 'blog_', 64 | 'strict' => false, 65 | ], 66 | 67 | 'pgsql' => [ 68 | 'driver' => 'pgsql', 69 | 'host' => env('DB_HOST', 'localhost'), 70 | 'database' => env('DB_DATABASE', 'forge'), 71 | 'username' => env('DB_USERNAME', 'forge'), 72 | 'password' => env('DB_PASSWORD', ''), 73 | 'charset' => 'utf8', 74 | 'prefix' => '', 75 | 'schema' => 'public', 76 | ], 77 | 78 | 'sqlsrv' => [ 79 | 'driver' => 'sqlsrv', 80 | 'host' => env('DB_HOST', 'localhost'), 81 | 'database' => env('DB_DATABASE', 'forge'), 82 | 'username' => env('DB_USERNAME', 'forge'), 83 | 'password' => env('DB_PASSWORD', ''), 84 | 'prefix' => '', 85 | ], 86 | 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Migration Repository Table 92 | |-------------------------------------------------------------------------- 93 | | 94 | | This table keeps track of all the migrations that have already run for 95 | | your application. Using this information, we can determine which of 96 | | the migrations on disk haven't actually been run in the database. 97 | | 98 | */ 99 | 100 | 'migrations' => 'migrations', 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Redis Databases 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Redis is an open source, fast, and advanced key-value store that also 108 | | provides a richer set of commands than a typical key-value systems 109 | | such as APC or Memcached. Laravel makes it easy to dig right in. 110 | | 111 | */ 112 | 113 | 'redis' => [ 114 | 115 | 'cluster' => false, 116 | 117 | 'default' => [ 118 | 'host' => '127.0.0.1', 119 | 'port' => 6379, 120 | 'database' => 0, 121 | ], 122 | 123 | ], 124 | 125 | ]; 126 | -------------------------------------------------------------------------------- /config/debugbar.php: -------------------------------------------------------------------------------- 1 | config('app.debug'), 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Storage settings 19 | |-------------------------------------------------------------------------- 20 | | 21 | | DebugBar stores data for session/ajax requests. 22 | | You can disable this, so the debugbar stores data in headers/session, 23 | | but this can cause problems with large data collectors. 24 | | By default, file storage (in the storage folder) is used. Redis and PDO 25 | | can also be used. For PDO, run the package migrations first. 26 | | 27 | */ 28 | 'storage' => array( 29 | 'enabled' => true, 30 | 'driver' => 'file', // redis, file, pdo 31 | 'path' => storage_path() . '/debugbar', // For file driver 32 | 'connection' => null, // Leave null for default connection (Redis/PDO) 33 | ), 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Vendors 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Vendor files are included by default, but can be set to false. 41 | | This can also be set to 'js' or 'css', to only include javascript or css vendor files. 42 | | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) 43 | | and for js: jquery and and highlight.js 44 | | So if you want syntax highlighting, set it to true. 45 | | jQuery is set to not conflict with existing jQuery scripts. 46 | | 47 | */ 48 | 49 | 'include_vendors' => true, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Capture Ajax Requests 54 | |-------------------------------------------------------------------------- 55 | | 56 | | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors), 57 | | you can use this option to disable sending the data through the headers. 58 | | 59 | */ 60 | 61 | 'capture_ajax' => true, 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | DataCollectors 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Enable/disable DataCollectors 69 | | 70 | */ 71 | 72 | 'collectors' => array( 73 | 'phpinfo' => true, // Php version 74 | 'messages' => true, // Messages 75 | 'time' => true, // Time Datalogger 76 | 'memory' => true, // Memory usage 77 | 'exceptions' => true, // Exception displayer 78 | 'log' => true, // Logs from Monolog (merged in messages if enabled) 79 | 'db' => true, // Show database (PDO) queries and bindings 80 | 'views' => true, // Views with their data 81 | 'route' => true, // Current route information 82 | 'laravel' => true, // Laravel version and environment 83 | 'events' => true, // All events fired 84 | 'default_request' => true, // Regular or special Symfony request logger 85 | 'symfony_request' => true, // Only one can be enabled.. 86 | 'mail' => true, // Catch mail messages 87 | 'logs' => true, // Add the latest log messages 88 | 'files' => true, // Show the included files 89 | 'config' => true, // Display config settings 90 | 'auth' => true, // Display Laravel authentication status 91 | 'session' => true, // Display session data in a separate tab 92 | ), 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Extra options 97 | |-------------------------------------------------------------------------- 98 | | 99 | | Configure some DataCollectors 100 | | 101 | */ 102 | 103 | 'options' => array( 104 | 'auth' => array( 105 | 'show_name' => false, // Also show the users name/email in the debugbar 106 | ), 107 | 'db' => array( 108 | 'with_params' => true, // Render SQL with the parameters substituted 109 | 'timeline' => false, // Add the queries to the timeline 110 | 'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files. 111 | 'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries 112 | 'enabled' => false, 113 | 'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+ 114 | ), 115 | 'hints' => true, // Show hints for common mistakes 116 | ), 117 | 'mail' => array( 118 | 'full_log' => false 119 | ), 120 | 'views' => array( 121 | 'data' => false, //Note: Can slow down the application, because the data can be quite large.. 122 | ), 123 | 'route' => array( 124 | 'label' => true // show complete route on bar 125 | ), 126 | 'logs' => array( 127 | 'file' => null 128 | ), 129 | ), 130 | 131 | /* 132 | |-------------------------------------------------------------------------- 133 | | Inject Debugbar in Response 134 | |-------------------------------------------------------------------------- 135 | | 136 | | Usually, the debugbar is added just before , by listening to the 137 | | Response after the App is done. If you disable this, you have to add them 138 | | in your template yourself. See http://phpdebugbar.com/docs/rendering.html 139 | | 140 | */ 141 | 142 | 'inject' => true, 143 | 144 | ); 145 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path().'/app', 49 | ], 50 | 51 | 's3' => [ 52 | 'driver' => 's3', 53 | 'key' => 'your-key', 54 | 'secret' => 'your-secret', 55 | 'region' => 'your-region', 56 | 'bucket' => 'your-bucket', 57 | ], 58 | 59 | 'rackspace' => [ 60 | 'driver' => 'rackspace', 61 | 'username' => 'your-username', 62 | 'key' => 'your-key', 63 | 'container' => 'your-container', 64 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 65 | 'region' => 'IAD', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /config/htmlmin.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Automatic Blade Optimizations 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option enables minification of the the blade views as they are 20 | | compiled. These optimizations have little impact on php processing time 21 | | as the optimizations are only applied once and are cached. This package 22 | | will do nothing by default to allow it to be used without minifying 23 | | pages automatically. 24 | | 25 | | Default: false 26 | | 27 | */ 28 | 29 | 'blade' => true, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Force Blade Optimizations 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This option forces blade minification on views where there such 37 | | minification may be dangerous. This should only be used if you are fully 38 | | aware of the potential issues this may cause. Obviously, this setting is 39 | | dependent on blade minification actually being enabled. 40 | | 41 | | PLEASE USE WITH CAUTION 42 | | 43 | | Default: false 44 | | 45 | */ 46 | 47 | 'force' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Automatic Live Optimizations 52 | |-------------------------------------------------------------------------- 53 | | 54 | | This option enables minification of the html responses just before they 55 | | are served. These optimizations have greater impact on php processing 56 | | time as the optimizations are applied on every request. This package 57 | | will do nothing by default to allow it to be used without minifying 58 | | pages automatically. 59 | | 60 | | Default: false 61 | | 62 | */ 63 | 64 | 'live' => false, 65 | 66 | ]; 67 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => ['address' => null, 'name' => null], 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Queue Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the connection information for each server that 27 | | is used by your application. A default configuration has been added 28 | | for each back-end shipped with Laravel. You are free to add more. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sync' => [ 35 | 'driver' => 'sync', 36 | ], 37 | 38 | 'database' => [ 39 | 'driver' => 'database', 40 | 'table' => 'jobs', 41 | 'queue' => 'default', 42 | 'expire' => 60, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'ttr' => 60, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => 'your-public-key', 55 | 'secret' => 'your-secret-key', 56 | 'queue' => 'your-queue-url', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'iron' => [ 61 | 'driver' => 'iron', 62 | 'host' => 'mq-aws-us-east-1.iron.io', 63 | 'token' => 'your-token', 64 | 'project' => 'your-project-id', 65 | 'queue' => 'your-queue-name', 66 | 'encrypt' => true, 67 | ], 68 | 69 | 'redis' => [ 70 | 'driver' => 'redis', 71 | 'queue' => 'default', 72 | 'expire' => 60, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Failed Queue Jobs 80 | |-------------------------------------------------------------------------- 81 | | 82 | | These options configure the behavior of failed queue job logging so you 83 | | can control which database and table are used to store the jobs that 84 | | have failed. You may change them to any database / table you wish. 85 | | 86 | */ 87 | 88 | 'failed' => [ 89 | 'database' => 'mysql', 'table' => 'failed_jobs', 90 | ], 91 | 92 | ]; 93 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => '', 19 | 'secret' => '', 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => '', 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => '', 28 | 'secret' => '', 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => 'User', 34 | 'secret' => '', 35 | ], 36 | 37 | ]; 38 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path().'/framework/sessions', 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Sweeping Lottery 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Some session drivers must manually sweep their storage location to get 94 | | rid of old sessions from storage. Here are the chances that it will 95 | | happen on a given request. By default, the odds are 2 out of 100. 96 | | 97 | */ 98 | 99 | 'lottery' => [2, 100], 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Name 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Here you may change the name of the cookie used to identify a session 107 | | instance by ID. The name specified here will get used every time a 108 | | new session cookie is created by the framework for every driver. 109 | | 110 | */ 111 | 112 | 'cookie' => 'laravel_session', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Path 117 | |-------------------------------------------------------------------------- 118 | | 119 | | The session cookie path determines the path for which the cookie will 120 | | be regarded as available. Typically, this will be the root path of 121 | | your application but you are free to change this when necessary. 122 | | 123 | */ 124 | 125 | 'path' => '/', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Domain 130 | |-------------------------------------------------------------------------- 131 | | 132 | | Here you may change the domain of the cookie used to identify a session 133 | | in your application. This will determine which domains the cookie is 134 | | available to in your application. A sensible default has been set. 135 | | 136 | */ 137 | 138 | 'domain' => null, 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | HTTPS Only Cookies 143 | |-------------------------------------------------------------------------- 144 | | 145 | | By setting this option to true, session cookies will only be sent back 146 | | to the server if the browser has a HTTPS connection. This will keep 147 | | the cookie from being sent to you if it can not be done securely. 148 | | 149 | */ 150 | 151 | 'secure' => false, 152 | 153 | ]; 154 | -------------------------------------------------------------------------------- /config/sitemap.php: -------------------------------------------------------------------------------- 1 | false, 6 | 'cache_key' => 'Laravel.Sitemap.' . config('app.url'), 7 | 'cache_duration' => 3600, 8 | 'escaping' => true, 9 | ]; -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')) 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path().'/framework/views'), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/database/migrations/.gitkeep -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 15 | $table->string('username'); 16 | $table->string('email')->unique(); 17 | $table->string('password', 60); 18 | $table->rememberToken(); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down() 27 | { 28 | Schema::drop('users'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 15 | $table->string('token')->index(); 16 | $table->timestamp('created_at'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | */ 23 | public function down() 24 | { 25 | Schema::drop('password_resets'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/migrations/2015_02_13_122151_create_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 15 | $table->string('name'); 16 | $table->string('slug')->nullable(); 17 | $table->integer('parent_id')->default(0); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | */ 25 | public function down() 26 | { 27 | Schema::drop('categories'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/migrations/2015_02_13_142235_create_articles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 15 | $table->string('title'); 16 | $table->text('body'); 17 | $table->string('slug')->nullable(); 18 | $table->integer('click')->default(100); 19 | $table->string('original')->nullable(); 20 | $table->integer('user_id')->unsigned(); 21 | $table->integer('category_id')->unsigned(); 22 | $table->softDeletes(); 23 | $table->timestamps(); 24 | 25 | $table->foreign('user_id') 26 | ->references('id') 27 | ->on('users') 28 | ->onDelete('cascade'); 29 | 30 | $table->foreign('category_id') 31 | ->references('id') 32 | ->on('categories') 33 | ->onDelete('cascade'); 34 | }); 35 | } 36 | 37 | /** 38 | * Reverse the migrations. 39 | */ 40 | public function down() 41 | { 42 | Schema::drop('articles'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/2015_02_13_155726_create_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 15 | $table->string('name'); 16 | $table->string('slug')->nullable(); 17 | $table->timestamps(); 18 | }); 19 | 20 | Schema::create('article_tag', function (Blueprint $table) { 21 | $table->increments('id'); 22 | 23 | $table->integer('article_id')->unsigned()->index(); 24 | $table->foreign('article_id')->references('id')->on('articles')->onDelete('cascade'); 25 | 26 | $table->integer('tag_id')->unsigned()->index(); 27 | $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade'); 28 | 29 | $table->timestamps(); 30 | 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | */ 37 | public function down() 38 | { 39 | Schema::drop('tags'); 40 | Schema::drop('article_tag'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2015_02_22_054359_create_settings_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 15 | $table->string('name'); 16 | $table->string('value')->nullable(); 17 | $table->string('description')->nullable(); 18 | $table->enum('type', ['text', 'textarea', 'select', 'checkbox', 'radio'])->default('text'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down() 27 | { 28 | Schema::drop('settings'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/database/seeds/.gitkeep -------------------------------------------------------------------------------- /database/seeds/ArticlesTableSeeder.php: -------------------------------------------------------------------------------- 1 | $faker->sentence, 19 | 'body' => $faker->paragraph(20), 20 | 'click' => $faker->numberBetween(100, 9000), 21 | 'slug' => $faker->unique()->slug, 22 | 'category_id' => $faker->randomElement($categoryIds), 23 | 'user_id' => $faker->randomElement($userIds), 24 | 'original' => $faker->optional(0.5)->url, 25 | 'created_at' => $faker->dateTimeThisYear(), 26 | 'updated_at' => $faker->dateTimeThisYear(), 27 | 'deleted_at' => $faker->optional(0.1)->dateTimeThisYear(), 28 | ]); 29 | 30 | $tags = $faker->randomElements($tagIds, 3); 31 | 32 | $article->tags()->sync($tags); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/seeds/CategoriesTableSeeder.php: -------------------------------------------------------------------------------- 1 | $faker->word, 14 | 'slug' => $faker->slug, 15 | 'parent_id' => '0', 16 | 'created_at' => $faker->dateTimeThisYear(), 17 | 'updated_at' => $faker->dateTimeThisYear(), 18 | ]); 19 | 20 | foreach (range(1, 10) as $index) { 21 | $categoryIds = \App\Category::whereParentId('0')->lists('id'); 22 | 23 | \App\Category::create([ 24 | 'name' => $faker->unique()->word, 25 | 'slug' => $faker->unique()->slug, 26 | 'parent_id' => $faker->optional(0.5, '0')->randomElement($categoryIds), 27 | 'created_at' => $faker->dateTimeThisYear(), 28 | 'updated_at' => $faker->dateTimeThisYear(), 29 | ]); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UsersTableSeeder'); 16 | $this->call('TagsTableSeeder'); 17 | $this->call('CategoriesTableSeeder'); 18 | $this->call('ArticlesTableSeeder'); 19 | $this->call('SettingsTableSeeder'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeds/SettingsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 'site_name', 12 | 'value' => '林大帅的博客', 13 | 'description' => '站点名称', 14 | 'type' => 'text', 15 | ]); 16 | 17 | Setting::create([ 18 | 'name' => 'site_description', 19 | 'value' => 'Designing && Developing', 20 | 'description' => '站点描述', 21 | 'type' => 'text', 22 | ]); 23 | 24 | Setting::create([ 25 | 'name' => 'site_keywords', 26 | 'value' => '林大帅的博客, 设计, 开发', 27 | 'description' => '站点关键字', 28 | 'type' => 'text', 29 | ]); 30 | 31 | Setting::create([ 32 | 'name' => 'site_url', 33 | 'value' => 'http://www.90door.com/', 34 | 'description' => '站点网址', 35 | 'type' => 'text', 36 | ]); 37 | 38 | Setting::create([ 39 | 'name' => 'admin_id', 40 | 'value' => '1', 41 | 'description' => '后台管理员ID', 42 | 'type' => 'text', 43 | ]); 44 | 45 | Setting::create([ 46 | 'name' => 'bei_an', 47 | 'value' => '闽ICP备15000000号-1', 48 | 'description' => '站点备案号', 49 | 'type' => 'text', 50 | ]); 51 | 52 | Setting::create([ 53 | 'name' => 'tong_ji', 54 | 'value' => '', 55 | 'description' => '站点统计代码', 56 | 'type' => 'text', 57 | ]); 58 | 59 | Setting::create([ 60 | 'name' => 'cdn_domain', 61 | 'value' => 'http://source.90door.com', 62 | 'description' => '七牛cdn加速域名', 63 | 'type' => 'text', 64 | ]); 65 | 66 | Setting::create([ 67 | 'name' => 'cdn_on', 68 | 'value' => '0', 69 | 'description' => '七牛cdn加速开关,1 or 0', 70 | 'type' => 'text', 71 | ]); 72 | 73 | Setting::create([ 74 | 'name' => 'page_size', 75 | 'value' => '8', 76 | 'description' => '博文列表每页显示博文数量', 77 | 'type' => 'text', 78 | ]); 79 | 80 | Setting::create([ 81 | 'name' => 'expire', 82 | 'value' => '1', 83 | 'description' => '缓存过期时间,单位分钟', 84 | 'type' => 'text', 85 | ]); 86 | 87 | Setting::create([ 88 | 'name' => 'comment_on', 89 | 'value' => '1', 90 | 'description' => '文章评论开关,1 or 0', 91 | 'type' => 'text', 92 | ]); 93 | 94 | Setting::create([ 95 | 'name' => 'register_on', 96 | 'value' => '0', 97 | 'description' => '会员注册开关,1 or 0', 98 | 'type' => 'text', 99 | ]); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /database/seeds/TagsTableSeeder.php: -------------------------------------------------------------------------------- 1 | $faker->unique()->word, 15 | 'slug' => $faker->unique()->slug, 16 | 'created_at' => $faker->dateTimeThisYear(), 17 | 'updated_at' => $faker->dateTimeThisYear(), 18 | ]); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | 'ganto', 11 | 'email' => 'ganto@qq.com', 12 | 'password' => Hash::make('123456'), 13 | ]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Elixir Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 9 | | for your Laravel application. By default, we are compiling the Less 10 | | file for our application, as well as publishing vendor resources. 11 | | 12 | */ 13 | 14 | elixir(function(mix) { 15 | 16 | //mix.sass('app.scss', 'resources/assets/css'); 17 | 18 | mix.styles([ 19 | 'bootstrap.min.css', 20 | 'highlight-default.css', 21 | 'home.css' 22 | ]); 23 | 24 | mix.scripts([ 25 | 'jquery.min.js', 26 | 'bootstrap.min.js', 27 | 'highlight.js' 28 | ]) 29 | 30 | mix.version(['css/all.css', 'js/all.js']); 31 | }); 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "gulp": "^3.8.8", 4 | "laravel-elixir": "*" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | main: 3 | namespace: App 4 | psr4_prefix: App 5 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | /phpmyadmin -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/admin-assets/css/metisMenu.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | 10 | .arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"} -------------------------------------------------------------------------------- /public/admin-assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/admin-assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/admin-assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/admin-assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/admin-assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/admin-assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/admin-assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/admin-assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/admin-assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/admin-assets/js/continuelist.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/, 15 | emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/, 16 | unorderedListRE = /[*+-]\s/; 17 | 18 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 19 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 20 | var ranges = cm.listSelections(), replacements = []; 21 | for (var i = 0; i < ranges.length; i++) { 22 | var pos = ranges[i].head, match; 23 | var eolState = cm.getStateAfter(pos.line); 24 | var inList = eolState.list !== false; 25 | var inQuote = eolState.quote !== false; 26 | 27 | if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) { 28 | cm.execCommand("newlineAndIndent"); 29 | return; 30 | } 31 | if (cm.getLine(pos.line).match(emptyListRE)) { 32 | cm.replaceRange("", { 33 | line: pos.line, ch: 0 34 | }, { 35 | line: pos.line, ch: pos.ch + 1 36 | }); 37 | replacements[i] = "\n"; 38 | 39 | } else { 40 | var indent = match[1], after = match[4]; 41 | var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 42 | ? match[2] 43 | : (parseInt(match[3], 10) + 1) + "."; 44 | 45 | replacements[i] = "\n" + indent + bullet + after; 46 | } 47 | } 48 | 49 | cm.replaceSelections(replacements); 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /public/admin-assets/js/jquery.inline-attachment.js: -------------------------------------------------------------------------------- 1 | /*jslint newcap: true */ 2 | /*global inlineAttachment: false, jQuery: false */ 3 | /** 4 | * jQuery plugin for inline attach 5 | * 6 | * @param {document} document 7 | * @param {window} window 8 | * @param {jQuery} $ 9 | */ 10 | (function(document, window, $) { 11 | 'use strict'; 12 | 13 | inlineAttachment.editors.jquery = {}; 14 | 15 | /** 16 | * Creates a new editor using jQuery 17 | */ 18 | var editor = function(instance) { 19 | 20 | var $this = $(instance); 21 | 22 | return { 23 | getValue: function() { 24 | return $this.val(); 25 | }, 26 | insertValue: function(val) { 27 | inlineAttachment.util.insertTextAtCursor($this[0], val); 28 | }, 29 | setValue: function(val) { 30 | $this.val(val); 31 | } 32 | }; 33 | }; 34 | 35 | $.fn.inlineattachment = function(options) { 36 | 37 | var set = $(this); 38 | 39 | set.each(function() { 40 | 41 | var $this = $(this), 42 | ed = new editor($this), 43 | inlineattach = new inlineAttachment(options, ed); 44 | 45 | $this.bind({ 46 | 'paste': function(e) { 47 | inlineattach.onPaste(e.originalEvent); 48 | }, 49 | 'drop': function(e) { 50 | e.stopPropagation(); 51 | e.preventDefault(); 52 | inlineattach.onDrop(e.originalEvent); 53 | }, 54 | 'dragenter dragover': function(e) { 55 | e.stopPropagation(); 56 | e.preventDefault(); 57 | } 58 | }); 59 | }); 60 | 61 | return this; 62 | }; 63 | 64 | inlineAttachment.editors.jquery.Editor = editor; 65 | 66 | })(document, window, jQuery); -------------------------------------------------------------------------------- /public/admin-assets/js/metisMenu.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document); -------------------------------------------------------------------------------- /public/admin-assets/js/sb-admin-2.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#side-menu').metisMenu(); 4 | 5 | }); 6 | 7 | //Loads the correct sidebar on window load, 8 | //collapses the sidebar on window resize. 9 | // Sets the min-height of #page-wrapper to window size 10 | $(function() { 11 | $(window).bind("load resize", function() { 12 | topOffset = 50; 13 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; 14 | if (width < 768) { 15 | $('div.navbar-collapse').addClass('collapse'); 16 | topOffset = 100; // 2-row-menu 17 | } else { 18 | $('div.navbar-collapse').removeClass('collapse'); 19 | } 20 | 21 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; 22 | height = height - topOffset; 23 | if (height < 1) height = 1; 24 | if (height > topOffset) { 25 | $("#page-wrapper").css("min-height", (height) + "px"); 26 | } 27 | }); 28 | 29 | var url = window.location; 30 | var element = $('ul.nav a').filter(function() { 31 | return this.href == url || url.href.indexOf(this.href) == 0; 32 | }).addClass('active').parent().parent().addClass('in').parent(); 33 | if (element.is('li')) { 34 | element.addClass('active'); 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /public/build/rev-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "css/all.css": "css/all-71c0cf33.css", 3 | "js/all.js": "js/all-3c7b3210.js" 4 | } -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader for 15 | | our application. We just need to utilize it! We'll simply require it 16 | | into the script here so that we don't have to worry about manual 17 | | loading any of our classes later on. It feels nice to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let us turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight our users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/app.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have prepared for them. 46 | | 47 | */ 48 | 49 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/uploads/images/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # laravel-blog 2 | 3 | ## Installation 4 | 5 | git clone https://github.com/gantoday/laravel-blog.git projectname 6 | cd projectname 7 | composer install 8 | create a database and inform .env 9 | php artisan key:generate 10 | php artisan migrate to create tables 11 | php artisan db:seed to populate tables 12 | 13 | default user ['ganto@qq.com' => '123456'] 14 | 15 | >redis or memcached cache is required. 16 | 17 | >homestead is recommended. 18 | -------------------------------------------------------------------------------- /resources/css/highlight-default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #f0f0f0; 12 | -webkit-text-size-adjust: none; 13 | } 14 | 15 | .hljs, 16 | .hljs-subst, 17 | .hljs-tag .hljs-title, 18 | .nginx .hljs-title { 19 | color: black; 20 | } 21 | 22 | .hljs-string, 23 | .hljs-title, 24 | .hljs-constant, 25 | .hljs-parent, 26 | .hljs-tag .hljs-value, 27 | .hljs-rules .hljs-value, 28 | .hljs-preprocessor, 29 | .hljs-pragma, 30 | .haml .hljs-symbol, 31 | .ruby .hljs-symbol, 32 | .ruby .hljs-symbol .hljs-string, 33 | .hljs-template_tag, 34 | .django .hljs-variable, 35 | .smalltalk .hljs-class, 36 | .hljs-addition, 37 | .hljs-flow, 38 | .hljs-stream, 39 | .bash .hljs-variable, 40 | .pf .hljs-variable, 41 | .apache .hljs-tag, 42 | .apache .hljs-cbracket, 43 | .tex .hljs-command, 44 | .tex .hljs-special, 45 | .erlang_repl .hljs-function_or_atom, 46 | .asciidoc .hljs-header, 47 | .markdown .hljs-header, 48 | .coffeescript .hljs-attribute { 49 | color: #800; 50 | } 51 | 52 | .smartquote, 53 | .hljs-comment, 54 | .hljs-annotation, 55 | .diff .hljs-header, 56 | .hljs-chunk, 57 | .asciidoc .hljs-blockquote, 58 | .markdown .hljs-blockquote { 59 | color: #888; 60 | } 61 | 62 | .hljs-number, 63 | .hljs-date, 64 | .hljs-regexp, 65 | .hljs-literal, 66 | .hljs-hexcolor, 67 | .smalltalk .hljs-symbol, 68 | .smalltalk .hljs-char, 69 | .go .hljs-constant, 70 | .hljs-change, 71 | .lasso .hljs-variable, 72 | .makefile .hljs-variable, 73 | .asciidoc .hljs-bullet, 74 | .markdown .hljs-bullet, 75 | .asciidoc .hljs-link_url, 76 | .markdown .hljs-link_url { 77 | color: #080; 78 | } 79 | 80 | .hljs-label, 81 | .hljs-javadoc, 82 | .ruby .hljs-string, 83 | .hljs-decorator, 84 | .hljs-filter .hljs-argument, 85 | .hljs-localvars, 86 | .hljs-array, 87 | .hljs-attr_selector, 88 | .hljs-important, 89 | .hljs-pseudo, 90 | .hljs-pi, 91 | .haml .hljs-bullet, 92 | .hljs-doctype, 93 | .hljs-deletion, 94 | .hljs-envvar, 95 | .hljs-shebang, 96 | .apache .hljs-sqbracket, 97 | .nginx .hljs-built_in, 98 | .tex .hljs-formula, 99 | .erlang_repl .hljs-reserved, 100 | .hljs-prompt, 101 | .asciidoc .hljs-link_label, 102 | .markdown .hljs-link_label, 103 | .vhdl .hljs-attribute, 104 | .clojure .hljs-attribute, 105 | .asciidoc .hljs-attribute, 106 | .lasso .hljs-attribute, 107 | .coffeescript .hljs-property, 108 | .hljs-phony { 109 | color: #88f; 110 | } 111 | 112 | .hljs-keyword, 113 | .hljs-id, 114 | .hljs-title, 115 | .hljs-built_in, 116 | .css .hljs-tag, 117 | .hljs-javadoctag, 118 | .hljs-phpdoc, 119 | .hljs-dartdoc, 120 | .hljs-yardoctag, 121 | .smalltalk .hljs-class, 122 | .hljs-winutils, 123 | .bash .hljs-variable, 124 | .pf .hljs-variable, 125 | .apache .hljs-tag, 126 | .hljs-type, 127 | .hljs-typename, 128 | .tex .hljs-command, 129 | .asciidoc .hljs-strong, 130 | .markdown .hljs-strong, 131 | .hljs-request, 132 | .hljs-status { 133 | font-weight: bold; 134 | } 135 | 136 | .asciidoc .hljs-emphasis, 137 | .markdown .hljs-emphasis { 138 | font-style: italic; 139 | } 140 | 141 | .nginx .hljs-built_in { 142 | font-weight: normal; 143 | } 144 | 145 | .coffeescript .javascript, 146 | .javascript .xml, 147 | .lasso .markup, 148 | .tex .hljs-formula, 149 | .xml .javascript, 150 | .xml .vbscript, 151 | .xml .css, 152 | .xml .hljs-cdata { 153 | opacity: 0.5; 154 | } 155 | -------------------------------------------------------------------------------- /resources/css/home.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Globals 3 | */ 4 | 5 | body { 6 | font-family: Georgia, "Times New Roman", Times, serif; 7 | color: #555; 8 | } 9 | 10 | h1, .h1, 11 | h2, .h2, 12 | h3, .h3, 13 | h4, .h4, 14 | h5, .h5, 15 | h6, .h6 { 16 | margin-top: 0; 17 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 18 | font-weight: normal; 19 | color: #333; 20 | } 21 | 22 | 23 | /* 24 | * Override Bootstrap's default container. 25 | */ 26 | 27 | @media (min-width: 1200px) { 28 | .container { 29 | width: 970px; 30 | } 31 | } 32 | 33 | 34 | /* 35 | * Masthead for nav 36 | */ 37 | 38 | .blog-masthead { 39 | background-color: #428bca; 40 | -webkit-box-shadow: inset 0 -2px 5px rgba(0,0,0,.1); 41 | box-shadow: inset 0 -2px 5px rgba(0,0,0,.1); 42 | } 43 | 44 | /* Nav links */ 45 | .blog-nav-item { 46 | position: relative; 47 | display: inline-block; 48 | padding: 10px; 49 | font-weight: 500; 50 | color: #cdddeb; 51 | } 52 | .blog-nav-item:hover, 53 | .blog-nav-item:focus { 54 | color: #fff; 55 | text-decoration: none; 56 | } 57 | 58 | /* Active state gets a caret at the bottom */ 59 | .blog-nav .active { 60 | color: #fff; 61 | } 62 | .blog-nav .active:after { 63 | position: absolute; 64 | bottom: 0; 65 | left: 50%; 66 | width: 0; 67 | height: 0; 68 | margin-left: -5px; 69 | vertical-align: middle; 70 | content: " "; 71 | border-right: 5px solid transparent; 72 | border-bottom: 5px solid; 73 | border-left: 5px solid transparent; 74 | } 75 | 76 | 77 | /* 78 | * Blog name and description 79 | */ 80 | 81 | .blog-header { 82 | padding-top: 20px; 83 | padding-bottom: 20px; 84 | } 85 | .blog-title { 86 | margin-top: 30px; 87 | margin-bottom: 0; 88 | font-size: 60px; 89 | font-weight: normal; 90 | } 91 | .blog-description { 92 | font-size: 20px; 93 | color: #999; 94 | } 95 | 96 | 97 | /* 98 | * Main column and sidebar layout 99 | */ 100 | 101 | .blog-main { 102 | font-size: 18px; 103 | line-height: 1.5; 104 | } 105 | 106 | /* Sidebar modules for boxing content */ 107 | .sidebar-module { 108 | padding: 15px; 109 | margin: 0 -15px 15px; 110 | } 111 | .sidebar-module-inset { 112 | padding: 15px; 113 | background-color: #f5f5f5; 114 | border-radius: 4px; 115 | } 116 | .sidebar-module-inset p:last-child, 117 | .sidebar-module-inset ul:last-child, 118 | .sidebar-module-inset ol:last-child { 119 | margin-bottom: 0; 120 | } 121 | 122 | 123 | /* Pagination */ 124 | .pager { 125 | margin-bottom: 60px; 126 | text-align: left; 127 | } 128 | .pager > li > a { 129 | width: 140px; 130 | padding: 10px 20px; 131 | text-align: center; 132 | border-radius: 30px; 133 | } 134 | 135 | 136 | /* 137 | * Blog posts 138 | */ 139 | 140 | .blog-post-title { 141 | margin-bottom: 5px; 142 | font-size: 40px; 143 | } 144 | .blog-post-meta { 145 | margin-bottom: 20px; 146 | color: #999; 147 | } 148 | .blog-post-meta a { 149 | color: #696565; 150 | text-decoration: underline; 151 | } 152 | 153 | 154 | /* 155 | * Footer 156 | */ 157 | 158 | .blog-footer { 159 | padding: 40px 0; 160 | color: #999; 161 | text-align: center; 162 | background-color: #f9f9f9; 163 | border-top: 1px solid #e5e5e5; 164 | } 165 | .blog-footer p:last-child { 166 | margin-bottom: 0; 167 | } 168 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | "user" => "We can't find a user with that e-mail address.", 18 | "token" => "This password reset token is invalid.", 19 | "sent" => "We have e-mailed your password reset link!", 20 | "reset" => "Your password has been reset!", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => [ 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ], 30 | "boolean" => "The :attribute field must be true or false.", 31 | "confirmed" => "The :attribute confirmation does not match.", 32 | "date" => "The :attribute is not a valid date.", 33 | "date_format" => "The :attribute does not match the format :format.", 34 | "different" => "The :attribute and :other must be different.", 35 | "digits" => "The :attribute must be :digits digits.", 36 | "digits_between" => "The :attribute must be between :min and :max digits.", 37 | "email" => "The :attribute must be a valid email address.", 38 | "filled" => "The :attribute field is required.", 39 | "exists" => "The selected :attribute is invalid.", 40 | "image" => "The :attribute must be an image.", 41 | "in" => "The selected :attribute is invalid.", 42 | "integer" => "The :attribute must be an integer.", 43 | "ip" => "The :attribute must be a valid IP address.", 44 | "max" => [ 45 | "numeric" => "The :attribute may not be greater than :max.", 46 | "file" => "The :attribute may not be greater than :max kilobytes.", 47 | "string" => "The :attribute may not be greater than :max characters.", 48 | "array" => "The :attribute may not have more than :max items.", 49 | ], 50 | "mimes" => "The :attribute must be a file of type: :values.", 51 | "min" => [ 52 | "numeric" => "The :attribute must be at least :min.", 53 | "file" => "The :attribute must be at least :min kilobytes.", 54 | "string" => "The :attribute must be at least :min characters.", 55 | "array" => "The :attribute must have at least :min items.", 56 | ], 57 | "not_in" => "The selected :attribute is invalid.", 58 | "numeric" => "The :attribute must be a number.", 59 | "regex" => "The :attribute format is invalid.", 60 | "required" => "The :attribute field is required.", 61 | "required_if" => "The :attribute field is required when :other is :value.", 62 | "required_with" => "The :attribute field is required when :values is present.", 63 | "required_with_all" => "The :attribute field is required when :values is present.", 64 | "required_without" => "The :attribute field is required when :values is not present.", 65 | "required_without_all" => "The :attribute field is required when none of :values are present.", 66 | "same" => "The :attribute and :other must match.", 67 | "size" => [ 68 | "numeric" => "The :attribute must be :size.", 69 | "file" => "The :attribute must be :size kilobytes.", 70 | "string" => "The :attribute must be :size characters.", 71 | "array" => "The :attribute must contain :size items.", 72 | ], 73 | "unique" => "The :attribute has already been taken.", 74 | "url" => "The :attribute format is invalid.", 75 | "timezone" => "The :attribute must be a valid zone.", 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Custom Validation Language Lines 80 | |-------------------------------------------------------------------------- 81 | | 82 | | Here you may specify custom validation messages for attributes using the 83 | | convention "attribute.rule" to name the lines. This makes it quick to 84 | | specify a specific custom language line for a given attribute rule. 85 | | 86 | */ 87 | 88 | 'custom' => [ 89 | 'attribute-name' => [ 90 | 'rule-name' => 'custom-message', 91 | ], 92 | ], 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Custom Validation Attributes 97 | |-------------------------------------------------------------------------- 98 | | 99 | | The following language lines are used to swap attribute place-holders 100 | | with something more reader friendly such as E-Mail Address instead 101 | | of "email". This simply helps us make messages a little cleaner. 102 | | 103 | */ 104 | 105 | 'attributes' => [], 106 | 107 | ]; 108 | -------------------------------------------------------------------------------- /resources/views/aaa.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 7 | 8 |

aaaaaaaaaaaaaaaaaaa

9 | 10 | 11 | -------------------------------------------------------------------------------- /resources/views/admin/articles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Add Articles

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::open(['url' => 'admin/articles']) !!} 17 | @include('admin.articles.form',['submitButtonText'=>'Add Article', 'form_date'=>date('Y-m-d')]) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/articles/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Edit Articles:{{ $article->title }}

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::model($article,['method'=>'PATCH','url' => 'admin/articles/'.$article->id]) !!} 17 | @include('admin.articles.form',['submitButtonText'=>'Update Article', 'form_date'=>$article->created_at->format('Y-m-d')]) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/articles/form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {!! Form::label('title', 'Title:') !!} 3 | {!! Form::text('title', null, ['class' => 'form-control', 'autofocus' => 'autofocus']) !!} 4 |
5 | 6 |
7 | {!! Form::label('body', 'Body:') !!} 8 | {!! Form::textarea('body', null, ['id' => 'editor', 'class' => 'form-control', 'placeholder' => 'Please Enter some text...', 'style' => 'overflow-x:hidden', 'rows' => '22']) !!} 9 |
10 | 11 |
12 | {!! Form::label('slug', 'Slug:') !!} 13 | {!! Form::text('slug', null, ['class' => 'form-control']) !!} 14 |
15 | 16 |
17 | {!! Form::label('category_id', 'Category:') !!} 18 | 36 |
37 | 38 |
39 | {!! Form::label('tag_list', 'Tags:') !!} 40 | {!! Form::select('tag_list[]', $tags, null, ['id' => 'tag_list', 'class' => 'form-control', 'multiple']) !!} 41 |
42 | 43 |
44 | {!! Form::label('created_at', 'Time:') !!} 45 | {!! Form::input('date', 'created_at', $form_date, ['class' => 'form-control']) !!} 46 |
47 | 48 |
49 | {!! Form::label('original', 'Original:') !!} 50 | {!! Form::text('original', null, ['class' => 'form-control']) !!} 51 |
52 | 53 |
54 | {!! Form::submit($submitButtonText, ['class' => 'btn btn-primary form-control']) !!} 55 |
56 | 57 | @section('header') 58 | 59 | 60 | @stop 61 | 62 | @section('footer') 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 94 | @stop 95 | -------------------------------------------------------------------------------- /resources/views/admin/articles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |

Articles

7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | @foreach($articles as $article) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 44 | 45 | @endforeach 46 | 47 |
#TitleCategoryTagsClickCreated_atAction
{{ $article->id }}{{ $article->title }}{{ $article->category->name }}@foreach($article->tags as $tag){{ $tag->name }} @endforeach {{ $article->click }}{{ $article->created_at }} 36 | {!! Form::open(['method' => 'get', 'url' => 'admin/articles/'.$article->id.'/edit', 'style' => 'float:left;margin-right: 10px;']) !!} 37 | 38 | {!! Form::close() !!} 39 | 40 | {!! Form::open(['method' => 'delete', 'url' => 'admin/articles/'.$article->id, 'style' => 'float:left;margin-right: 10px;']) !!} 41 | 42 | {!! Form::close() !!} 43 |
48 |
49 |
50 |
51 | 每页{{ $articles->count() }}条,共{{ $articles->lastPage() }}页,总{{ $articles->total() }}条. 52 |
53 |
54 | {!! $articles->render() !!} 55 |
56 |
57 |
58 | 59 |
60 | 61 | @endsection 62 | -------------------------------------------------------------------------------- /resources/views/admin/articles/trash.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |

Articles Trash

7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @foreach($articles as $article) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 | @endforeach 48 | 49 |
#TitleCategoryTagsClickDeleted_atCreated_atAction
{{ $article->id }}{{ $article->title }}{{ $article->category->name }}@foreach($article->tags as $tag){{ $tag->name }} @endforeach {{ $article->click }}{{ $article->deleted_at }}{{ $article->created_at }} 38 | {!! Form::open(['method' => 'post', 'url' => 'admin/articles/restore/'.$article->id, 'style' => 'float:left;margin-right: 10px;']) !!} 39 | 40 | {!! Form::close() !!} 41 | 42 | {!! Form::open(['method' => 'delete', 'url' => ['admin/articles/forceDelete',$article->id], 'style' => 'float:left;margin-right: 10px;']) !!} 43 | 44 | {!! Form::close() !!} 45 |
50 |
51 |
52 |
53 |
54 | 每页{{ $articles->count() }}条,共{{ $articles->lastPage() }}页,总{{ $articles->total() }}条. 55 |
56 |
57 |
58 |
59 | {!! $articles->render() !!} 60 |
61 |
62 |
63 |
64 | 65 |
66 | 67 | @endsection 68 | -------------------------------------------------------------------------------- /resources/views/admin/categories/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Add Categories

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::open(['url' => 'admin/categories']) !!} 17 | @include('admin.categories.form',['submitButtonText'=>'Add Category']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/categories/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Edit Category:{{ $category->name }}

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::model($category,['method'=>'PATCH','url' => 'admin/categories/'.$category->id]) !!} 17 | @include('admin.categories.form',['submitButtonText'=>'Update Category']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/categories/form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {!! Form::label('name', 'Name:') !!} 3 | {!! Form::text('name', null, ['class' => 'form-control', 'autofocus' => 'autofocus']) !!} 4 |
5 | 6 |
7 | {!! Form::label('slug', 'Slug:') !!} 8 | {!! Form::text('slug', null, ['class' => 'form-control']) !!} 9 |
10 | 11 |
12 | {!! Form::label('parent_id', 'Parent:') !!} 13 | {!! Form::select('parent_id', $categories, null, ['id' => 'parent_id', 'class' => 'form-control']) !!} 14 |
15 | 16 |
17 | {!! Form::submit($submitButtonText, ['class' => 'btn btn-primary form-control']) !!} 18 |
19 | 20 | @section('header') 21 | 22 | @endsection 23 | 24 | @section('footer') 25 | 26 | 29 | @endsection 30 | -------------------------------------------------------------------------------- /resources/views/admin/categories/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |

Categories

7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach($categories as $category) 27 | 28 | 29 | 33 | 34 | 35 | 36 | 45 | 46 | @endforeach 47 | 48 |
#NameSlugArticlesCreated_atAction
{{ $category->id }} 30 | @if($category->parent_id)    — @endif 31 | {{ $category->name }} 32 | {{ $category->slug }}{{ $category->articles()->count() }}{{ $category->created_at }} 37 | {!! Form::open(['method' => 'get', 'url' => 'admin/categories/'.$category->id.'/edit', 'style' => 'float:left;margin-right: 10px;']) !!} 38 | 39 | {!! Form::close() !!} 40 | 41 | {!! Form::open(['method' => 'delete', 'url' => 'admin/categories/'.$category->id, 'style' => 'float:left;margin-right: 10px;']) !!} 42 | 43 | {!! Form::close() !!} 44 |
49 |
50 |
51 | 52 |
53 | 54 | @endsection 55 | -------------------------------------------------------------------------------- /resources/views/admin/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Dashboard

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 | 19 |
20 |
21 |
26
22 |
New Comments!
23 |
24 |
25 |
26 | 27 | 32 | 33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | 41 |
42 |
43 |
12
44 |
New Tasks!
45 |
46 |
47 |
48 | 49 | 54 | 55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 63 |
64 |
65 |
124
66 |
New Orders!
67 |
68 |
69 |
70 | 71 | 76 | 77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | 85 |
86 |
87 |
13
88 |
Support Tickets!
89 |
90 |
91 |
92 | 93 | 98 | 99 |
100 |
101 |
102 | 103 | 104 | 105 | @endsection 106 | -------------------------------------------------------------------------------- /resources/views/admin/layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {{ $title or setting('site_name').'-管理面板' }} 13 | 14 | @include('admin.partials.header') 15 | @yield('header') 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 31 | 32 |
33 | 34 | @include('flash::message') 35 | 36 | @yield('content') 37 | 38 |
39 |
40 | @include('errors.list') 41 |
42 |
43 |
44 | 45 | 46 |
47 | 48 | 49 | @include('admin.partials.footer') 50 | @yield('footer') 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /resources/views/admin/login.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Please Sign In 13 | 14 | @include('admin.partials.header') 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 | 58 |
59 |
60 |
61 | 62 | @include('admin.partials.footer') 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /resources/views/admin/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /resources/views/admin/partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /resources/views/admin/partials/navbar.blade.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 176 | 177 | -------------------------------------------------------------------------------- /resources/views/admin/partials/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 76 | 77 | -------------------------------------------------------------------------------- /resources/views/admin/settings/form.blade.php: -------------------------------------------------------------------------------- 1 | @foreach($settings as $setting) 2 |
3 | {!! Form::label($setting->name, $setting->description.':') !!} 4 | {!! Form::text($setting->name, $setting->value, ['class' => 'form-control']) !!} 5 |
6 | @endforeach 7 | 8 |
9 | {!! Form::submit('Update Settings', ['class' => 'btn btn-primary form-control']) !!} 10 |
11 | -------------------------------------------------------------------------------- /resources/views/admin/settings/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Site Settings

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::model($settings,['method'=>'PATCH','url' => 'admin/settings/index']) !!} 17 | @include('admin.settings.form') 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/tags/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Add Tags

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::open(['url' => 'admin/tags']) !!} 17 | @include('admin.tags.form',['submitButtonText'=>'Add Tag']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/tags/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Edit Tag:{{ $tag->name }}

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::model($tag,['method'=>'PATCH','url' => 'admin/tags/'.$tag->id]) !!} 17 | @include('admin.tags.form',['submitButtonText'=>'Update Tag']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/tags/form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {!! Form::label('name', 'Name:') !!} 3 | {!! Form::text('name', null, ['class' => 'form-control', 'autofocus' => 'autofocus']) !!} 4 |
5 | 6 |
7 | {!! Form::label('slug', 'Slug:') !!} 8 | {!! Form::text('slug', null, ['class' => 'form-control']) !!} 9 |
10 | 11 |
12 | {!! Form::submit($submitButtonText, ['class' => 'btn btn-primary form-control']) !!} 13 |
14 | 15 | @section('header') 16 | 17 | @endsection 18 | 19 | @section('footer') 20 | 26 | @endsection 27 | -------------------------------------------------------------------------------- /resources/views/admin/tags/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |

Tags

7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach($tags as $tag) 27 | 28 | 29 | 30 | 31 | 32 | 33 | 42 | 43 | @endforeach 44 | 45 |
#NameSlugArticlesCreated_atAction
{{ $tag->id }}{{ $tag->name }}{{ $tag->slug }}{{ $tag->articles()->count() }}{{ $tag->created_at }} 34 | {!! Form::open(['method' => 'get', 'url' => 'admin/tags/'.$tag->id.'/edit', 'style' => 'float:left;margin-right: 10px;']) !!} 35 | 36 | {!! Form::close() !!} 37 | 38 | {!! Form::open(['method' => 'delete', 'url' => 'admin/tags/'.$tag->id, 'style' => 'float:left;margin-right: 10px;']) !!} 39 | 40 | {!! Form::close() !!} 41 |
46 |
47 |
48 |
49 |
50 | 每页{{ $tags->count() }}条,共{{ $tags->lastPage() }}页,总{{ $tags->total() }}条. 51 |
52 |
53 |
54 |
55 | {!! $tags->render() !!} 56 |
57 |
58 |
59 |
60 | 61 |
62 | 63 | @endsection 64 | -------------------------------------------------------------------------------- /resources/views/admin/users/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Add Articles

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::open(['url' => 'admin/articles']) !!} 17 | @include('admin.articles.form',['submitButtonText'=>'Add Article']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/users/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 | 5 |
6 |
7 |

Edit Articles:{{ $article->title }}

8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 |
16 | {!! Form::model($article,['method'=>'PATCH','url' => 'admin/articles/'.$article->id]) !!} 17 | @include('admin.articles.form',['submitButtonText'=>'Update Article']) 18 | {!! Form::close() !!} 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | @stop 28 | -------------------------------------------------------------------------------- /resources/views/admin/users/form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {!! Form::label('title', 'Title:') !!} 3 | {!! Form::text('title', null, ['class' => 'form-control', 'autofocus' => 'autofocus']) !!} 4 |
5 | 6 |
7 | {!! Form::label('body', 'Body:') !!} 8 | {!! Form::textarea('body', null, ['id' => 'editor', 'class' => 'form-control', 'placeholder' => 'Please Enter some text...', 'style' => 'overflow:hidden', 'rows' => '20']) !!} 9 |
10 | 11 |
12 | {!! Form::label('slug', 'Slug:') !!} 13 | {!! Form::text('slug', null, ['class' => 'form-control']) !!} 14 |
15 | 16 |
17 | {!! Form::label('category', 'Category:') !!} 18 | {!! Form::select('category_id', $categories, null, ['class' => 'form-control']) !!} 19 |
20 | 21 |
22 | {!! Form::label('tag_list', 'Tags:') !!} 23 | {!! Form::select('tag_list[]', $tags, null, ['id' => 'tag_list', 'class' => 'form-control', 'multiple']) !!} 24 |
25 | 26 |
27 | {!! Form::submit($submitButtonText, ['class' => 'btn btn-primary form-control']) !!} 28 |
29 | 30 | @section('header') 31 | 32 | @endsection 33 | 34 | @section('footer') 35 | 36 | 37 | 38 | 49 | @endsection 50 | -------------------------------------------------------------------------------- /resources/views/admin/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |

Articles

7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | @foreach($articles as $article) 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 44 | 45 | @endforeach 46 | 47 |
#TitleCategoryTagsClickCreated_atAction
{{ $article->id }}{{ $article->title }}{{ $article->category->name }}@foreach($article->tags as $tag){{ $tag->name }} @endforeach {{ $article->click }}{{ $article->created_at }} 36 | {!! Form::open(['method' => 'get', 'url' => 'admin/articles/'.$article->id.'/edit', 'style' => 'float:left;margin-right: 10px;']) !!} 37 | 38 | {!! Form::close() !!} 39 | 40 | {!! Form::open(['method' => 'delete', 'url' => 'admin/articles/'.$article->id, 'style' => 'float:left;margin-right: 10px;']) !!} 41 | 42 | {!! Form::close() !!} 43 |
48 |
49 |
50 |
51 |
52 | 每页{{ $articles->count() }}条,共{{ $articles->lastPage() }}页,总{{ $articles->total() }}条. 53 |
54 |
55 |
56 |
57 | {!! $articles->render() !!} 58 |
59 |
60 |
61 |
62 | 63 |
64 | 65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 | 44 |
45 |
46 |
47 | 48 |
49 |
50 | 53 | 54 | Forgot Your Password? 55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | @endsection 64 | -------------------------------------------------------------------------------- /resources/views/auth/password.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 |
10 | @if (session('status')) 11 |
12 | {{ session('status') }} 13 |
14 | @endif 15 | 16 | @if (count($errors) > 0) 17 |
18 | Whoops! There were some problems with your input.

19 |
    20 | @foreach ($errors->all() as $error) 21 |
  • {{ $error }}
  • 22 | @endforeach 23 |
24 |
25 | @endif 26 | 27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 | 37 |
38 |
39 | 42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | @endsection 51 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 | 40 |
41 | 42 |
43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 |
51 | 52 |
53 |
54 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/auth/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 |
10 | @if (count($errors) > 0) 11 |
12 | Whoops! There were some problems with your input.

13 |
    14 | @foreach ($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 |
19 | @endif 20 | 21 |
22 | 23 | 24 | 25 |
26 | 27 |
28 | 29 |
30 |
31 | 32 |
33 | 34 |
35 | 36 |
37 |
38 | 39 |
40 | 41 |
42 | 43 |
44 |
45 | 46 |
47 |
48 | 51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | @endsection 60 | -------------------------------------------------------------------------------- /resources/views/emails/password.blade.php: -------------------------------------------------------------------------------- 1 | Click here to reset your password: {{ url('password/reset/'.$token) }} 2 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 33 | 34 | 35 |
36 |
37 |
Be right back.
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /resources/views/errors/list.blade.php: -------------------------------------------------------------------------------- 1 | @if ($errors->any()) 2 | 7 | @endif 8 | -------------------------------------------------------------------------------- /resources/views/home/articles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('title'){{ '博文列表 第'.$articles->currentPage().'页 | '.setting('site_name') }}@stop 4 | 5 | @section('content') 6 |
7 | @foreach($articles as $article) 8 |
9 |

{{ $article->title }}

10 | 15 | {!! str_limit($article->body_html, $limit = 500, $end = '...') !!} 16 |
17 |
18 | @endforeach 19 | 20 | 23 | 24 |
25 | @stop 26 | -------------------------------------------------------------------------------- /resources/views/home/articles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('title'){{ $article->title.' | '.setting('site_name') }}@stop 4 | 5 | @section('description'){{ setting('site_name').' | '.description_trim($article->body_html) }}@stop 6 | 7 | @section('content') 8 |
9 |
10 |

{{ $article->title }}

11 | 16 | {!! $article->body_html !!} 17 | @unless(is_null($article->original) || empty($article->original)) 18 |

参考来源:
{{ $article->original }}

19 | @endunless 20 |

本文链接:
{{ setting('site_url').$article->slug }}

21 |
22 |
23 | 24 | 25 |
26 | 27 | 28 | 39 | 40 | 41 | 42 |
43 | @stop 44 | -------------------------------------------------------------------------------- /resources/views/home/categories/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 | 5 | @stop 6 | -------------------------------------------------------------------------------- /resources/views/home/categories/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('title'){{ $category->name.'分类 博文列表 第'.$articles->currentPage().'页 | '.setting('site_name') }}@stop 4 | 5 | @section('content') 6 |
7 | @foreach($articles as $article) 8 |
9 |

{{ $article->title }}

10 | 15 | {!! str_limit($article->body_html, $limit = 500, $end = '...') !!} 16 |
17 |
18 | @endforeach 19 | 20 | 23 | 24 |
25 | @stop 26 | -------------------------------------------------------------------------------- /resources/views/home/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('title'){{ setting('site_name').' | '.setting('site_description') }}@stop 4 | 5 | @section('content') 6 |
7 | @foreach($articles as $article) 8 |
9 |

{{ $article->title }}

10 | 15 | {!! str_limit($article->body_html, $limit = 500, $end = '...') !!} 16 |
17 |
18 | @endforeach 19 | 20 | 21 | More Articles 22 | 23 |
24 | @stop 25 | -------------------------------------------------------------------------------- /resources/views/home/layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | @yield('title', setting('site_name')) 11 | 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | @include('home.partials.nav') 25 | 26 |
27 | 28 |
29 |

{{ setting('site_name') }}

30 |

{{ setting('site_description') }}

31 |
32 | 33 |
34 | 35 | @yield('content') 36 | 37 | @include('home.partials.sidebar') 38 | 39 |
40 | 41 |
42 | 43 | 50 | 51 | 52 | 53 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /resources/views/home/partials/flash.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @if(Session::has('flash_message')) 3 |
4 | @if(Session::has('flash_message_important')) 5 | 6 | @endif 7 | {{ session('flash_message') }} 8 |
9 | @endif 10 | -------------------------------------------------------------------------------- /resources/views/home/partials/nav.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 13 |
14 |
15 | -------------------------------------------------------------------------------- /resources/views/home/partials/sidebar.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 15 | 23 | 31 | 41 |
42 | -------------------------------------------------------------------------------- /resources/views/home/tags/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('content') 4 | 5 | @stop 6 | -------------------------------------------------------------------------------- /resources/views/home/tags/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('home.layout') 2 | 3 | @section('title'){{ $tag->name.'标签 博文列表 第'.$articles->currentPage().'页 | '.setting('site_name') }}@stop 4 | 5 | @section('content') 6 |
7 | @foreach($articles as $article) 8 |
9 |

{{ $article->title }}

10 | 15 | {!! str_limit($article->body_html, $limit = 500, $end = '...') !!} 16 |
17 |
18 | @endforeach 19 | 20 | 23 | 24 |
25 | @stop 26 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gantoday/laravel-blog/87faaee5ae4b9d0b54d344719cde1b75c8f8d6e5/resources/views/vendor/.gitkeep -------------------------------------------------------------------------------- /resources/views/vendor/flash/message.blade.php: -------------------------------------------------------------------------------- 1 | @if (Session::has('flash_notification.message')) 2 | @if (Session::has('flash_notification.overlay')) 3 | @include('flash::modal', ['modalClass' => 'flash-modal', 'title' => Session::get('flash_notification.title'), 'body' => Session::get('flash_notification.message')]) 4 | @else 5 |
6 | 7 | 8 | {{ Session::get('flash_notification.message') }} 9 |
10 | @endif 11 | @endif 12 | -------------------------------------------------------------------------------- /resources/views/vendor/flash/modal.blade.php: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/html.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ $channel['title'] }} 5 | 6 | 7 |

{{ $channel['title'] }}

8 | 16 | 17 | -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/ror-rdf.blade.php: -------------------------------------------------------------------------------- 1 | {!! '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" !!} 2 | 3 | 4 | {{ $channel['title'] }} 5 | {{ $channel['link'] }} 6 | sitemap 7 | 8 | @foreach($items as $item) 9 | 10 | {{ $item['loc'] }} 11 | {{ $item['title'] }} 12 | {{ date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) }} 13 | {{ $item['freq'] }} 14 | {{ $item['priority'] }} 15 | 16 | 17 | @endforeach 18 | -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/ror-rss.blade.php: -------------------------------------------------------------------------------- 1 | {!! '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" !!} 2 | 3 | 4 | {{ $channel['title'] }} 5 | {{ $channel['link'] }} 6 | @foreach($items as $item) 7 | 8 | {{ $item['loc'] }} 9 | {{ $item['title'] }} 10 | {{ date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) }} 11 | {{ $item['freq'] }} 12 | {{ $item['priority'] }} 13 | sitemap 14 | 15 | @endforeach 16 | 17 | -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/sitemapindex.blade.php: -------------------------------------------------------------------------------- 1 | {!! '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" !!} 2 | 3 | @foreach($sitemaps as $sitemap) 4 | 5 | {{ $sitemap['loc'] }} 6 | @if($sitemap['lastmod'] !== null){{ date('Y-m-d\TH:i:sP', strtotime($sitemap['lastmod'])) }}@endif 7 | 8 | @endforeach 9 | -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/txt.blade.php: -------------------------------------------------------------------------------- 1 | @foreach($items as $item) 2 | {{ $item['loc'] . "\n" }} 3 | @endforeach -------------------------------------------------------------------------------- /resources/views/vendor/sitemap/xml.blade.php: -------------------------------------------------------------------------------- 1 | {!! '<'.'?'.'xml version="1.0" encoding="UTF-8"?>' !!} 2 | 3 | @foreach($items as $item) 4 | 5 | {{ $item['loc'] }} 6 | ' . "\n"; 11 | } 12 | } 13 | 14 | if ($item['priority'] !== null) { 15 | echo "\t\t" . '' . $item['priority'] . '' . "\n"; 16 | } 17 | 18 | if ($item['lastmod'] !== null) { 19 | echo "\t\t" . '' . date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])) . '' . "\n"; 20 | } 21 | 22 | if ($item['freq'] !== null) { 23 | echo "\t\t" . '' . $item['freq'] . '' . "\n"; 24 | } 25 | 26 | if (!empty($item['images'])) { 27 | foreach($item['images'] as $image) { 28 | echo "\t\t" . '' . "\n"; 29 | echo "\t\t\t" . '' . $image['url'] . '' . "\n"; 30 | if (isset($image['title'])) echo "\t\t\t" . '' . $image['title'] . '' . "\n"; 31 | echo "\t\t\t" . '' . $image['caption'] . '' . "\n"; 32 | if (isset($image['geo_location'])) echo "\t\t\t" . '' . $image['geo_location'] . '' . "\n"; 33 | echo "\t\t" . '' . "\n"; 34 | } 35 | } 36 | 37 | ?> 38 | 39 | @endforeach 40 | 41 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $uri = urldecode( 10 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 11 | ); 12 | 13 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 14 | // built-in PHP web server. This provides a convenient way to test a Laravel 15 | // application without having installed a "real" web server software here. 16 | if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri)) 17 | { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/.gitignore: -------------------------------------------------------------------------------- 1 | laravel.log -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | call('GET', '/'); 13 | 14 | $this->assertEquals(200, $response->getStatusCode()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make('Illuminate\Contracts\Console\Kernel')->bootstrap(); 15 | 16 | return $app; 17 | } 18 | 19 | } 20 | --------------------------------------------------------------------------------