├── public ├── favicon.ico ├── robots.txt ├── uploads │ ├── home-bg.jpg │ ├── post-bg.jpg │ ├── about-bg.jpg │ └── contact-bg.jpg ├── assets │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── pickadate │ │ └── themes │ │ ├── rtl.css │ │ ├── default.time.css │ │ ├── classic.time.css │ │ ├── classic.css │ │ └── default.css ├── .htaccess └── index.php ├── app ├── Listeners │ └── .gitkeep ├── Events │ └── Event.php ├── Http │ ├── Requests │ │ ├── PostUpdateRequest.php │ │ ├── Request.php │ │ ├── ContactMeRequest.php │ │ ├── UploadFileRequest.php │ │ ├── UploadNewFolderRequest.php │ │ ├── TagUpdateRequest.php │ │ ├── TagCreateRequest.php │ │ └── PostCreateRequest.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── Auth │ │ │ └── AuthController.php │ │ ├── ContactController.php │ │ ├── BlogController.php │ │ └── Admin │ │ │ ├── PostController.php │ │ │ ├── TagController.php │ │ │ └── UploadController.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── RedirectIfAuthenticated.php │ │ └── Authenticate.php │ ├── Kernel.php │ └── routes.php ├── Providers │ ├── AppServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Jobs │ ├── Job.php │ ├── PostFormFields.php │ └── BlogIndexData.php ├── Services │ ├── Markdowner.php │ ├── SiteMap.php │ └── RssFeed.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── User.php ├── helpers.php ├── Exceptions │ └── Handler.php └── Tag.php ├── database ├── .gitignore ├── seeds │ ├── TagTableSeeder.php │ ├── DatabaseSeeder.php │ └── PostTableSeeder.php ├── migrations │ ├── 2015_06_27_074433_create_post_tag_pivot.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2015_06_21_174427_create_posts_table.php │ ├── 2015_06_28_085417_create_jobs_table.php │ ├── 2015_06_27_074414_create_tags_table.php │ └── 2015_06_27_123303_restructure_posts_table.php └── factories │ └── ModelFactory.php ├── resources ├── views │ ├── vendor │ │ └── .gitkeep │ ├── emails │ │ ├── test.blade.php │ │ └── contact.blade.php │ ├── admin │ │ ├── partials │ │ │ ├── errors.blade.php │ │ │ ├── success.blade.php │ │ │ └── navbar.blade.php │ │ ├── layout.blade.php │ │ ├── tag │ │ │ ├── create.blade.php │ │ │ ├── _form.blade.php │ │ │ ├── index.blade.php │ │ │ └── edit.blade.php │ │ └── post │ │ │ ├── index.blade.php │ │ │ └── create.blade.php │ ├── blog │ │ ├── partials │ │ │ ├── disqus.blade.php │ │ │ ├── page-nav.blade.php │ │ │ └── page-footer.blade.php │ │ ├── layouts │ │ │ ├── master.blade.php │ │ │ ├── post.blade.php │ │ │ └── index.blade.php │ │ └── contact.blade.php │ ├── errors │ │ └── 503.blade.php │ └── auth │ │ └── login.blade.php ├── assets │ ├── less │ │ ├── fontawesome │ │ │ ├── fixed-width.less │ │ │ ├── bordered-pulled.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── font-awesome.less │ │ │ ├── core.less │ │ │ ├── stacked.less │ │ │ ├── rotated-flipped.less │ │ │ ├── path.less │ │ │ ├── animated.less │ │ │ └── mixins.less │ │ ├── bootstrap │ │ │ ├── mixins │ │ │ │ ├── center-block.less │ │ │ │ ├── size.less │ │ │ │ ├── opacity.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── text-overflow.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── labels.less │ │ │ │ ├── resize.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── alerts.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── reset-text.less │ │ │ │ ├── pagination.less │ │ │ │ ├── panels.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── list-group.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── table-row.less │ │ │ │ ├── image.less │ │ │ │ ├── buttons.less │ │ │ │ ├── forms.less │ │ │ │ ├── grid-framework.less │ │ │ │ └── grid.less │ │ │ ├── wells.less │ │ │ ├── breadcrumbs.less │ │ │ ├── responsive-embed.less │ │ │ ├── component-animations.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── pager.less │ │ │ ├── media.less │ │ │ ├── jumbotron.less │ │ │ ├── mixins.less │ │ │ ├── labels.less │ │ │ ├── badges.less │ │ │ ├── bootstrap.less │ │ │ ├── code.less │ │ │ ├── grid.less │ │ │ ├── alerts.less │ │ │ ├── progress-bars.less │ │ │ ├── pagination.less │ │ │ ├── print.less │ │ │ ├── tooltip.less │ │ │ └── list-group.less │ │ ├── clean-blog │ │ │ ├── variables.less │ │ │ └── mixins.less │ │ ├── admin.less │ │ └── blog.less │ └── js │ │ └── blog.js └── lang │ └── en │ ├── pagination.php │ └── passwords.php ├── storage ├── app │ └── .gitignore ├── logs │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── .gitignore ├── .bowerrc ├── .gitattributes ├── phpspec.yml ├── package.json ├── readme.md ├── .env.example ├── tests ├── ExampleTest.php ├── TestCase.php └── Services │ └── MarkdownerTest.php ├── bower.json ├── config ├── blog.php ├── services.php ├── compile.php ├── view.php ├── broadcasting.php ├── cache.php ├── auth.php ├── filesystems.php └── queue.php ├── server.php ├── phpunit.xml ├── composer.json ├── artisan └── gulpfile.js /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Listeners/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | .env 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "vendor/bower_dl" 3 | } 4 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /public/uploads/home-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChuckHeintzelman/l5beauty/HEAD/public/uploads/home-bg.jpg -------------------------------------------------------------------------------- /public/uploads/post-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChuckHeintzelman/l5beauty/HEAD/public/uploads/post-bg.jpg -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/views/emails/test.blade.php: -------------------------------------------------------------------------------- 1 |

2 | This is a test, an email test. 3 |

4 |

5 | The variable $testVar contains the value: 6 |

7 | 10 |
11 |

12 | That is all. 13 |

14 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /database/seeds/TagTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /public/assets/pickadate/themes/rtl.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Styling for RTL (right-to-left) languages using pickadate.js 3 | */.picker{direction:rtl}.picker__nav--next{right:auto;left:-1em}.picker__nav--prev{left:auto;right:-1em}.picker__nav--next:before{border-left:0;border-right:.75em solid #000}.picker__nav--prev:before{border-right:0;border-left:.75em solid #000} -------------------------------------------------------------------------------- /resources/views/admin/partials/errors.blade.php: -------------------------------------------------------------------------------- 1 | @if (count($errors) > 0) 2 |
3 | Whoops! 4 | There were some problems with your input.

5 | 10 |
11 | @endif 12 | -------------------------------------------------------------------------------- /resources/views/admin/partials/success.blade.php: -------------------------------------------------------------------------------- 1 | @if (Session::has('success')) 2 |
3 | 4 | 5 | Success.   6 | 7 | {{ Session::get('success') }} 8 |
9 | @endif -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table !important; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /resources/views/emails/contact.blade.php: -------------------------------------------------------------------------------- 1 |

2 | You have received a new message from your website contact form. 3 |

4 |

5 | Here are the details: 6 |

7 | 12 |
13 |

14 | @foreach ($messageLines as $messageLine) 15 | {{ $messageLine }}
16 | @endforeach 17 |

18 |
19 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('TagTableSeeder'); 18 | $this->call('PostTableSeeder'); 19 | 20 | Model::reguard(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel 5'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "l5beauty", 3 | "description": "My awesome blog", 4 | "ignore": [ 5 | "**/.*", 6 | "node_modules", 7 | "vendor/bower_dl", 8 | "test", 9 | "tests" 10 | ], 11 | "dependencies": { 12 | "jquery": "~2.1.4", 13 | "bootstrap": "~3.3.5", 14 | "fontawesome": "~4.3.0", 15 | "datatables": "~1.10.7", 16 | "datatables-plugins": "~1.10.7", 17 | "selectize": "~0.12.1", 18 | "pickadate": "~3.5.6", 19 | "clean-blog": "~1.0.1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /config/blog.php: -------------------------------------------------------------------------------- 1 | "L5 Beauty", 4 | 'title' => "Laravel 5.1 Beauty", 5 | 'subtitle' => 'A clean blog written in Laravel 5.1', 6 | 'description' => 'This is my meta description', 7 | 'author' => 'Chuck Heintzelman', 8 | 'page_image' => 'home-bg.jpg', 9 | 'posts_per_page' => 10, 10 | 'rss_size' => 25, 11 | 'contact_email' => env('MAIL_FROM'), 12 | 'uploads' => [ 13 | 'storage' => 'local', 14 | 'webpath' => '/uploads/', 15 | ], 16 | ]; 17 | 18 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'required', 22 | 'email' => 'required|email', 23 | 'message' => 'required', 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Jobs/Job.php: -------------------------------------------------------------------------------- 1 | li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | line-height: @line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | .border-left-radius(@border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | .border-right-radius(@border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Requests/UploadFileRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 26 | 'folder' => 'required', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /app/Http/Requests/UploadNewFolderRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 26 | 'new_folder' => 'required', 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /app/Services/Markdowner.php: -------------------------------------------------------------------------------- 1 | preTransformText($text); 14 | $text = MarkdownExtra::defaultTransform($text); 15 | $text = SmartyPants::defaultTransform($text); 16 | $text = $this->postTransformText($text); 17 | return $text; 18 | } 19 | 20 | protected function preTransformText($text) 21 | { 22 | return $text; 23 | } 24 | 25 | protected function postTransformText($text) 26 | { 27 | return $text; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Requests/TagUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 27 | 'subtitle' => 'required', 28 | 'layout' => 'required', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a&, 9 | button& { 10 | color: @color; 11 | 12 | .list-group-item-heading { 13 | color: inherit; 14 | } 15 | 16 | &:hover, 17 | &:focus { 18 | color: @color; 19 | background-color: darken(@background, 5%); 20 | } 21 | &.active, 22 | &.active:hover, 23 | &.active:focus { 24 | color: #fff; 25 | background-color: @color; 26 | border-color: @color; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /tests/Services/MarkdownerTest.php: -------------------------------------------------------------------------------- 1 | markdown = new \App\Services\Markdowner(); 10 | } 11 | 12 | /** 13 | * @dataProvider conversionsProvider 14 | */ 15 | public function testConversions($value, $expected) 16 | { 17 | $this->assertEquals($expected, $this->markdown->toHTML($value)); 18 | } 19 | 20 | public function conversionsProvider() 21 | { 22 | return [ 23 | ["test", "

test

\n"], 24 | ["# title", "

title

\n"], 25 | ["Here's Johnny!", "

Here’s Johnny!

\n"], 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/TagCreateRequest.php: -------------------------------------------------------------------------------- 1 | 'required|unique:tags,tag', 27 | 'title' => 'required', 28 | 'subtitle' => 'required', 29 | 'layout' => 'required', 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('queue:work')->cron('* * * * * *'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/migrations/2015_06_27_074433_create_post_tag_pivot.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('post_id')->unsigned()->index(); 18 | $table->integer('tag_id')->unsigned()->index(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('post_tag_pivot'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any other events for your application. 23 | * 24 | * @param \Illuminate\Contracts\Events\Dispatcher $events 25 | * @return void 26 | */ 27 | public function boot(DispatcherContract $events) 28 | { 29 | parent::boot($events); 30 | 31 | // 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->string('email')->unique(); 19 | $table->string('password', 60); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('users'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2015_06_21_174427_create_posts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('slug')->unique(); 18 | $table->string('title'); 19 | $table->text('content'); 20 | $table->timestamps(); 21 | $table->timestamp('published_at')->index(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('posts'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/assets/less/blog.less: -------------------------------------------------------------------------------- 1 | @import "bootstrap/bootstrap"; 2 | @import "fontawesome/font-awesome"; 3 | @import "clean-blog/clean-blog"; 4 | 5 | @import "//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"; 6 | @import "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'"; 7 | 8 | \.intro-header .post-heading .meta a, 9 | article a { 10 | text-decoration: underline; 11 | } 12 | 13 | h2 { 14 | padding-top: 22px; 15 | } 16 | h3 { 17 | padding-top: 15px; 18 | } 19 | 20 | h2 + p, h3 + p, h4 + p { 21 | margin-top: 5px; 22 | } 23 | 24 | // Adjust position of captions 25 | \.caption-title { 26 | margin-bottom: 5px; 27 | } 28 | \.caption-title + p { 29 | margin-top: 0; 30 | } 31 | 32 | // Change the styling of dt/dd elements 33 | dt { 34 | margin-bottom: 5px; 35 | } 36 | dd { 37 | margin-left: 30px; 38 | margin-bottom: 10px; 39 | } 40 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/views/blog/partials/disqus.blade.php: -------------------------------------------------------------------------------- 1 | @if (App::environment() === 'production') 2 |
3 | 17 | 21 | 22 | comments powered by Disqus 23 | 24 | @endif 25 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->check()) { 38 | return redirect('/admin/post'); 39 | } 40 | 41 | return $next($request); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | app/ 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /resources/views/admin/partials/navbar.blade.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 31 | -------------------------------------------------------------------------------- /database/migrations/2015_06_28_085417_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 17 | $table->string('queue'); 18 | $table->longText('payload'); 19 | $table->tinyInteger('attempts')->unsigned(); 20 | $table->tinyInteger('reserved')->unsigned(); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::drop('jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2015_06_27_074414_create_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('tag')->unique(); 18 | $table->string('title'); 19 | $table->string('subtitle'); 20 | $table->string('page_image'); 21 | $table->string('meta_description'); 22 | $table->string('layout')->default('blog.layouts.index'); 23 | $table->boolean('reverse_direction'); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::drop('tags'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_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' => App\User::class, 34 | 'key' => '', 35 | 'secret' => '', 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->guest()) { 38 | if ($request->ajax()) { 39 | return response('Unauthorized.', 401); 40 | } else { 41 | return redirect()->guest('auth/login'); 42 | } 43 | } 44 | 45 | return $next($request); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | \App\Http\Middleware\Authenticate::class, 30 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 31 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/fontawesome/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | transform: translate(0, 0); // ensures no half-pixel rendering in firefox 12 | 13 | } 14 | 15 | .fa-icon-rotate(@degrees, @rotation) { 16 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 17 | -webkit-transform: rotate(@degrees); 18 | -ms-transform: rotate(@degrees); 19 | transform: rotate(@degrees); 20 | } 21 | 22 | .fa-icon-flip(@horiz, @vert, @rotation) { 23 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 24 | -webkit-transform: scale(@horiz, @vert); 25 | -ms-transform: scale(@horiz, @vert); 26 | transform: scale(@horiz, @vert); 27 | } 28 | -------------------------------------------------------------------------------- /database/seeds/PostTableSeeder.php: -------------------------------------------------------------------------------- 1 | all(); 17 | 18 | Post::truncate(); 19 | 20 | // Don't forget to truncate the pivot table 21 | DB::table('post_tag_pivot')->truncate(); 22 | 23 | factory(Post::class, 20)->create()->each(function ($post) use ($tags) { 24 | 25 | // 30% of the time don't assign a tag 26 | if (mt_rand(1, 100) <= 30) { 27 | return; 28 | } 29 | 30 | shuffle($tags); 31 | $postTags = [$tags[0]]; 32 | 33 | // 30$ of the time we're assigning tags, assign 2 34 | if (mt_rand(1, 100) <= 30) { 35 | $postTags[] = $tags[1]; 36 | } 37 | 38 | $post->syncTags($postTags); 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'getLogout']); 23 | } 24 | 25 | /** 26 | * Get a validator for an incoming registration request. 27 | * 28 | * @param array $data 29 | * @return \Illuminate\Contracts\Validation\Validator 30 | */ 31 | protected function validator(array $data) 32 | { 33 | return Validator::make($data, [ 34 | 'name' => 'required|max:255', 35 | 'email' => 'required|email|max:255|unique:users', 36 | 'password' => 'required|confirmed|min:6', 37 | ]); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/views/blog/partials/page-nav.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Navigation --}} 2 | 31 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | only('name', 'email', 'phone'); 28 | $data['messageLines'] = explode("\n", $request->get('message')); 29 | 30 | Mail::queue('emails.contact', $data, function ($message) use ($data) { 31 | $message->subject('Blog Contact Form: '.$data['name']) 32 | ->to(config('blog.contact_email')) 33 | ->replyTo($data['email']); 34 | }); 35 | 36 | return back() 37 | ->withSuccess("Thank you for your message. It has been sent."); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | group(['namespace' => $this->namespace], function ($router) { 41 | require app_path('Http/routes.php'); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/views/blog/layouts/master.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ $title or config('blog.title') }} 11 | 12 | 14 | 15 | {{-- Styles --}} 16 | 17 | @yield('styles') 18 | 19 | {{-- HTML5 Shim and Respond.js for IE8 support --}} 20 | 24 | 25 | 26 | @include('blog.partials.page-nav') 27 | 28 | @yield('page-header') 29 | @yield('content') 30 | 31 | @include('blog.partials.page-footer') 32 | 33 | {{-- Scripts --}} 34 | 35 | @yield('scripts') 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | get('contact', 'ContactController@showForm'); 10 | Route::post('contact', 'ContactController@sendContactInfo'); 11 | get('rss', 'BlogController@rss'); 12 | get('sitemap.xml', 'BlogController@siteMap'); 13 | 14 | // Admin area 15 | get('admin', function () { 16 | return redirect('/admin/post'); 17 | }); 18 | $router->group([ 19 | 'namespace' => 'Admin', 20 | 'middleware' => 'auth', 21 | ], function () { 22 | resource('admin/post', 'PostController', ['except' => 'show']); 23 | resource('admin/tag', 'TagController', ['except' => 'show']); 24 | get('admin/upload', 'UploadController@index'); 25 | post('admin/upload/file', 'UploadController@uploadFile'); 26 | delete('admin/upload/file', 'UploadController@deleteFile'); 27 | post('admin/upload/folder', 'UploadController@createFolder'); 28 | delete('admin/upload/folder', 'UploadController@deleteFolder'); 29 | }); 30 | 31 | // Logging in and out 32 | get('/auth/login', 'Auth\AuthController@getLogin'); 33 | post('/auth/login', 'Auth\AuthController@postLogin'); 34 | get('/auth/logout', 'Auth\AuthController@getLogout'); 35 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: @jumbotron-padding; 8 | padding-bottom: @jumbotron-padding; 9 | margin-bottom: @jumbotron-padding; 10 | color: @jumbotron-color; 11 | background-color: @jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: @jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: (@jumbotron-padding / 2); 20 | font-size: @jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken(@jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | } 32 | 33 | .container { 34 | max-width: 100%; 35 | } 36 | 37 | @media screen and (min-width: @screen-sm-min) { 38 | padding-top: (@jumbotron-padding * 1.6); 39 | padding-bottom: (@jumbotron-padding * 1.6); 40 | 41 | .container &, 42 | .container-fluid & { 43 | padding-left: (@jumbotron-padding * 2); 44 | padding-right: (@jumbotron-padding * 2); 45 | } 46 | 47 | h1, 48 | .h1 { 49 | font-size: @jumbotron-heading-font-size; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function ($faker) { 4 | return [ 5 | 'name' => $faker->name, 6 | 'email' => $faker->email, 7 | 'password' => str_random(10), 8 | 'remember_token' => str_random(10), 9 | ]; 10 | }); 11 | 12 | $factory->define(App\Post::class, function ($faker) { 13 | $images = ['about-bg.jpg', 'contact-bg.jpg', 'home-bg.jpg', 'post-bg.jpg']; 14 | $title = $faker->sentence(mt_rand(3, 10)); 15 | return [ 16 | 'title' => $title, 17 | 'subtitle' => str_limit($faker->sentence(mt_rand(10, 20)), 252), 18 | 'page_image' => $images[mt_rand(0, 3)], 19 | 'content_raw' => join("\n\n", $faker->paragraphs(mt_rand(3, 6))), 20 | 'published_at' => $faker->dateTimeBetween('-1 month', '+3 days'), 21 | 'meta_description' => "Meta for $title", 22 | 'is_draft' => false, 23 | ]; 24 | }); 25 | 26 | $factory->define(App\Tag::class, function ($faker) { 27 | $images = ['about-bg.jpg', 'contact-bg.jpg', 'home-bg.jpg', 'post-bg.jpg']; 28 | $word = $faker->word; 29 | return [ 30 | 'tag' => $word, 31 | 'title' => ucfirst($word), 32 | 'subtitle' => $faker->sentence, 33 | 'page_image' => $images[mt_rand(0, 3)], 34 | 'meta_description' => "Meta for $word", 35 | 'reverse_direction' => false, 36 | ]; 37 | }); 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/BlogController.php: -------------------------------------------------------------------------------- 1 | get('tag'); 18 | $data = $this->dispatch(new BlogIndexData($tag)); 19 | $layout = $tag ? Tag::layout($tag) : 'blog.layouts.index'; 20 | 21 | return view($layout, $data); 22 | } 23 | 24 | public function showPost($slug, Request $request) 25 | { 26 | $post = Post::with('tags')->whereSlug($slug)->firstOrFail(); 27 | $tag = $request->get('tag'); 28 | if ($tag) { 29 | $tag = Tag::whereTag($tag)->firstOrFail(); 30 | } 31 | 32 | return view($post->layout, compact('post', 'tag')); 33 | } 34 | 35 | public function rss(RssFeed $feed) 36 | { 37 | $rss = $feed->getRSS(); 38 | 39 | return response($rss) 40 | ->header('Content-type', 'application/rss+xml'); 41 | } 42 | 43 | public function siteMap(SiteMap $siteMap) 44 | { 45 | $map = $siteMap->getSiteMap(); 46 | 47 | return response($map) 48 | ->header('Content-type', 'text/xml'); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /resources/views/admin/layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('blog.title') }} Admin 9 | 10 | 11 | @yield('styles') 12 | 13 | 17 | 18 | 19 | 20 | 37 | 38 | @yield('content') 39 | 40 | 41 | 42 | @yield('scripts') 43 | 44 | 45 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Http/Requests/PostCreateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 26 | 'subtitle' => 'required', 27 | 'content' => 'required', 28 | 'publish_date' => 'required', 29 | 'publish_time' => 'required', 30 | 'layout' => 'required', 31 | ]; 32 | } 33 | 34 | /** 35 | * Return the fields and values to create a new post from 36 | */ 37 | public function postFillData() 38 | { 39 | $published_at = new Carbon( 40 | $this->publish_date.' '.$this->publish_time 41 | ); 42 | return [ 43 | 'title' => $this->title, 44 | 'subtitle' => $this->subtitle, 45 | 'page_image' => $this->page_image, 46 | 'content_raw' => $this->get('content'), 47 | 'meta_description' => $this->meta_description, 48 | 'is_draft' => (bool)$this->is_draft, 49 | 'published_at' => $published_at, 50 | 'layout' => $this->layout, 51 | ]; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /resources/assets/js/blog.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Blog Javascript 3 | * Copied from Clean Blog v1.0.0 (http://startbootstrap.com) 4 | */ 5 | 6 | // Navigation Scripts to Show Header on Scroll-Up 7 | jQuery(document).ready(function($) { 8 | var MQL = 1170; 9 | 10 | //primary navigation slide-in effect 11 | if ($(window).width() > MQL) { 12 | var headerHeight = $('.navbar-custom').height(); 13 | $(window).on('scroll', { 14 | previousTop: 0 15 | }, 16 | function() { 17 | var currentTop = $(window).scrollTop(); 18 | 19 | //if user is scrolling up 20 | if (currentTop < this.previousTop) { 21 | if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) { 22 | $('.navbar-custom').addClass('is-visible'); 23 | } else { 24 | $('.navbar-custom').removeClass('is-visible is-fixed'); 25 | } 26 | //if scrolling down... 27 | } else { 28 | $('.navbar-custom').removeClass('is-visible'); 29 | if (currentTop > headerHeight && 30 | !$('.navbar-custom').hasClass('is-fixed')) { 31 | $('.navbar-custom').addClass('is-fixed'); 32 | } 33 | } 34 | this.previousTop = currentTop; 35 | }); 36 | } 37 | 38 | // Initialize tooltips 39 | $('[data-toggle="tooltip"]').tooltip(); 40 | }); 41 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Broadcast Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the broadcast connections that will be used 24 | | to broadcast events to other systems or over websockets. Samples of 25 | | each available type of connection are provided inside this array. 26 | | 27 | */ 28 | 29 | 'connections' => [ 30 | 31 | 'pusher' => [ 32 | 'driver' => 'pusher', 33 | 'key' => env('PUSHER_KEY'), 34 | 'secret' => env('PUSHER_SECRET'), 35 | 'app_id' => env('PUSHER_APP_ID'), 36 | ], 37 | 38 | 'redis' => [ 39 | 'driver' => 'redis', 40 | 'connection' => 'default', 41 | ], 42 | 43 | 'log' => [ 44 | 'driver' => 'log', 45 | ], 46 | 47 | ], 48 | 49 | ]; 50 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | @import "variables.less"; 9 | @import "mixins.less"; 10 | 11 | // Reset and dependencies 12 | @import "normalize.less"; 13 | @import "print.less"; 14 | @import "glyphicons.less"; 15 | 16 | // Core CSS 17 | @import "scaffolding.less"; 18 | @import "type.less"; 19 | @import "code.less"; 20 | @import "grid.less"; 21 | @import "tables.less"; 22 | @import "forms.less"; 23 | @import "buttons.less"; 24 | 25 | // Components 26 | @import "component-animations.less"; 27 | @import "dropdowns.less"; 28 | @import "button-groups.less"; 29 | @import "input-groups.less"; 30 | @import "navs.less"; 31 | @import "navbar.less"; 32 | @import "breadcrumbs.less"; 33 | @import "pagination.less"; 34 | @import "pager.less"; 35 | @import "labels.less"; 36 | @import "badges.less"; 37 | @import "jumbotron.less"; 38 | @import "thumbnails.less"; 39 | @import "alerts.less"; 40 | @import "progress-bars.less"; 41 | @import "media.less"; 42 | @import "list-group.less"; 43 | @import "panels.less"; 44 | @import "responsive-embed.less"; 45 | @import "wells.less"; 46 | @import "close.less"; 47 | 48 | // Components w/ JavaScript 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | @import "carousel.less"; 53 | 54 | // Utility classes 55 | @import "utilities.less"; 56 | @import "responsive-utilities.less"; 57 | -------------------------------------------------------------------------------- /database/migrations/2015_06_27_123303_restructure_posts_table.php: -------------------------------------------------------------------------------- 1 | string('subtitle')->after('title'); 17 | $table->renameColumn('content', 'content_raw'); 18 | $table->text('content_html')->after('content'); 19 | $table->string('page_image')->after('content_html'); 20 | $table->string('meta_description')->after('page_image'); 21 | $table->boolean('is_draft')->after('meta_description'); 22 | $table->string('layout')->after('is_draft') 23 | ->default('blog.layouts.post'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('posts', function (Blueprint $table) { 35 | $table->dropColumn('layout'); 36 | $table->dropColumn('is_draft'); 37 | $table->dropColumn('meta_description'); 38 | $table->dropColumn('page_image'); 39 | $table->dropColumn('content_html'); 40 | $table->renameColumn('content_raw', 'content'); 41 | $table->dropColumn('subtitle'); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /public/assets/pickadate/themes/default.time.css: -------------------------------------------------------------------------------- 1 | .picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover,.picker__list-item:hover{background:#b1dcfb;cursor:pointer;color:#000}.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item--highlighted,.picker__list-item:hover{border-color:#0089ec;z-index:10}.picker--focused .picker__list-item--selected,.picker__list-item--selected,.picker__list-item--selected:hover{background:#0089ec;color:#fff;z-index:10}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff;border-color:#fff}.picker--time .picker__frame{min-width:256px;max-width:320px}.picker--time .picker__box{font-size:1em;background:#f2f2f2;padding:0}@media (min-height:40.125em){.picker--time .picker__box{margin-bottom:5em}} -------------------------------------------------------------------------------- /public/assets/pickadate/themes/classic.time.css: -------------------------------------------------------------------------------- 1 | .picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover,.picker__list-item:hover{background:#b1dcfb;cursor:pointer;color:#000}.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item--highlighted,.picker__list-item:hover{border-color:#0089ec;z-index:10}.picker--focused .picker__list-item--selected,.picker__list-item--selected,.picker__list-item--selected:hover{background:#0089ec;color:#fff;z-index:10}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff;border-color:#fff}.picker--time{min-width:256px;max-width:320px}.picker--time .picker__holder{background:#f2f2f2}@media (min-height:40.125em){.picker--time .picker__holder{font-size:.875em}}.picker--time .picker__box{padding:0;position:relative} -------------------------------------------------------------------------------- /public/assets/pickadate/themes/classic.css: -------------------------------------------------------------------------------- 1 | .picker,.picker__holder{width:100%;position:absolute}.picker{font-size:16px;text-align:left;line-height:1.2;color:#000;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{overflow-y:auto;-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;border-top-width:0;border-bottom-width:0;border-radius:0 0 5px 5px;box-sizing:border-box;min-width:176px;max-width:466px;max-height:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transform:translateY(-1em)perspective(600px)rotateX(10deg);transform:translateY(-1em)perspective(600px)rotateX(10deg);transition:-webkit-transform .15s ease-out,opacity .15s ease-out,max-height 0s .15s,border-width 0s .15s;transition:transform .15s ease-out,opacity .15s ease-out,max-height 0s .15s,border-width 0s .15s}/*! 2 | * Classic picker styling for pickadate.js 3 | * Demo: http://amsul.github.io/pickadate.js 4 | */.picker__frame{padding:1px}.picker__wrap{margin:-1px}.picker--opened .picker__holder{max-height:25em;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1;border-top-width:1px;border-bottom-width:1px;-webkit-transform:translateY(0)perspective(600px)rotateX(0);transform:translateY(0)perspective(600px)rotateX(0);transition:-webkit-transform .15s ease-out,opacity .15s ease-out,max-height 0s,border-width 0s;transition:transform .15s ease-out,opacity .15s ease-out,max-height 0s,border-width 0s;box-shadow:0 6px 18px 1px rgba(0,0,0,.12)} -------------------------------------------------------------------------------- /app/Tag.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Post', 'post_tag_pivot'); 22 | } 23 | 24 | /** 25 | * Add any tags needed from the list 26 | * 27 | * @param array $tags List of tags to check/add 28 | */ 29 | public static function addNeededTags(array $tags) 30 | { 31 | if (count($tags) === 0) { 32 | return; 33 | } 34 | 35 | $found = static::whereIn('tag', $tags)->lists('tag')->all(); 36 | 37 | foreach (array_diff($tags, $found) as $tag) { 38 | static::create([ 39 | 'tag' => $tag, 40 | 'title' => $tag, 41 | 'subtitle' => 'Subtitle for '.$tag, 42 | 'page_image' => '', 43 | 'meta_description' => '', 44 | 'reverse_direction' => false, 45 | ]); 46 | } 47 | } 48 | 49 | /** 50 | * Return the index layout to use for a tag 51 | * 52 | * @param string $tag 53 | * @param string $default 54 | * @return string 55 | */ 56 | public static function layout($tag, $default = 'blog.layouts.index') 57 | { 58 | $layout = static::whereTag($tag)->pluck('layout'); 59 | 60 | return $layout ?: $default; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /resources/views/admin/tag/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Tags » Create New Tag

8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |

New Tag Form

16 |
17 |
18 | 19 | @include('admin.partials.errors') 20 | 21 |
23 | 24 | 25 |
26 | 27 |
28 | 30 |
31 |
32 | 33 | @include('admin.tag._form') 34 | 35 |
36 |
37 | 41 |
42 |
43 | 44 |
45 | 46 |
47 |
48 |
49 |
50 |
51 | 52 | @stop -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &, 46 | &:hover, 47 | &:focus, 48 | &.focus, 49 | &:active, 50 | &.active { 51 | background-color: @background; 52 | border-color: @border; 53 | } 54 | } 55 | 56 | .badge { 57 | color: @background; 58 | background-color: @color; 59 | } 60 | } 61 | 62 | // Button sizes 63 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 64 | padding: @padding-vertical @padding-horizontal; 65 | font-size: @font-size; 66 | line-height: @line-height; 67 | border-radius: @border-radius; 68 | } 69 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=5.5.9", 9 | "laravel/framework": "5.1.*", 10 | "michelf/php-markdown": "^1.5", 11 | "michelf/php-smartypants": "1.6.0-beta1", 12 | "dflydev/apache-mime-types": "^1.0", 13 | "league/flysystem-aws-s3-v3": "^1.0", 14 | "doctrine/dbal": "^2.5", 15 | "guzzlehttp/guzzle": "~5.0", 16 | "suin/php-rss-writer": "^1.3" 17 | }, 18 | "require-dev": { 19 | "fzaninotto/faker": "~1.4", 20 | "mockery/mockery": "0.9.*", 21 | "phpunit/phpunit": "~4.0", 22 | "phpspec/phpspec": "~2.1" 23 | }, 24 | "autoload": { 25 | "classmap": [ 26 | "database" 27 | ], 28 | "psr-4": { 29 | "App\\": "app/" 30 | }, 31 | "files": [ 32 | "app/helpers.php" 33 | ] 34 | }, 35 | "autoload-dev": { 36 | "classmap": [ 37 | "tests/TestCase.php" 38 | ] 39 | }, 40 | "scripts": { 41 | "post-install-cmd": [ 42 | "php artisan clear-compiled", 43 | "php artisan optimize" 44 | ], 45 | "pre-update-cmd": [ 46 | "php artisan clear-compiled" 47 | ], 48 | "post-update-cmd": [ 49 | "php artisan optimize" 50 | ], 51 | "post-root-package-install": [ 52 | "php -r \"copy('.env.example', '.env');\"" 53 | ], 54 | "post-create-project-cmd": [ 55 | "php artisan key:generate" 56 | ] 57 | }, 58 | "config": { 59 | "preferred-install": "dist" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 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 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 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 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 |
10 | 11 | @include('admin.partials.errors') 12 | 13 |
15 | 16 | 17 |
18 | 19 |
20 | 22 |
23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 | 38 |
39 |
40 |
41 | 42 |
43 |
44 | 45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @endsection 54 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /app/Services/SiteMap.php: -------------------------------------------------------------------------------- 1 | buildSiteMap(); 21 | Cache::add('site-map', $siteMap, 120); 22 | return $siteMap; 23 | } 24 | 25 | /** 26 | * Build the Site Map 27 | */ 28 | protected function buildSiteMap() 29 | { 30 | $postsInfo = $this->getPostsInfo(); 31 | $dates = array_values($postsInfo); 32 | sort($dates); 33 | $lastmod = last($dates); 34 | $url = trim(url(), '/') . '/'; 35 | 36 | $xml = []; 37 | $xml[] = ''; 38 | $xml[] = ''; 39 | $xml[] = ' '; 40 | $xml[] = " $url"; 41 | $xml[] = " $lastmod"; 42 | $xml[] = ' daily'; 43 | $xml[] = ' 0.8'; 44 | $xml[] = ' '; 45 | 46 | foreach ($postsInfo as $slug => $lastmod) { 47 | $xml[] = ' '; 48 | $xml[] = " {$url}blog/$slug"; 49 | $xml[] = " $lastmod"; 50 | $xml[] = " "; 51 | } 52 | 53 | $xml[] = ''; 54 | 55 | return join("\n", $xml); 56 | } 57 | 58 | /** 59 | * Return all the posts as $url => $date 60 | */ 61 | protected function getPostsInfo() 62 | { 63 | return Post::where('published_at', '<=', Carbon::now()) 64 | ->where('is_draft', 0) 65 | ->orderBy('published_at', 'desc') 66 | ->lists('updated_at', 'slug') 67 | ->all(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /resources/views/admin/post/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Posts » Listing

8 |
9 | 14 |
15 | 16 |
17 |
18 | 19 | @include('admin.partials.errors') 20 | @include('admin.partials.success') 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @foreach ($posts as $post) 33 | 34 | 37 | 38 | 39 | 49 | 50 | @endforeach 51 | 52 |
PublishedTitleSubtitleActions
35 | {{ $post->published_at->format('j-M-y g:ia') }} 36 | {{ $post->title }}{{ $post->subtitle }} 40 | 42 | Edit 43 | 44 | 46 | View 47 | 48 |
53 |
54 |
55 | 56 |
57 | @stop 58 | 59 | @section('scripts') 60 | 67 | @stop -------------------------------------------------------------------------------- /public/assets/pickadate/themes/default.css: -------------------------------------------------------------------------------- 1 | .picker{font-size:16px;text-align:left;line-height:1.2;color:#000;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;position:fixed;transition:background .15s ease-out,-webkit-transform 0s .15s;transition:background .15s ease-out,transform 0s .15s;-webkit-backface-visibility:hidden}/*! 2 | * Default mobile-first, responsive styling for pickadate.js 3 | * Demo: http://amsul.github.io/pickadate.js 4 | */.picker__frame,.picker__holder{top:0;bottom:0;left:0;right:0;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:666px;width:100%;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;transition:all .15s ease-out}.picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}.picker__wrap{display:block}}.picker__box{background:#fff;display:table-cell;vertical-align:middle}@media (min-height:26.5em){.picker__box{font-size:1.25em}}@media (min-height:33.875em){.picker__box{display:block;font-size:1.33em;border:1px solid #777;border-top-color:#898989;border-bottom-width:0;border-radius:5px 5px 0 0;box-shadow:0 12px 36px 16px rgba(0,0,0,.24)}}@media (min-height:40.125em){.picker__frame{margin-bottom:7.5%}.picker__box{font-size:1.5em;border-bottom-width:1px;border-radius:5px}}.picker--opened .picker__holder{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);zoom:1;background:rgba(0,0,0,.32);transition:background .15s ease-out}.picker--opened .picker__frame{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1}@media (min-height:33.875em){.picker--opened .picker__frame{top:auto;bottom:0}} -------------------------------------------------------------------------------- /resources/views/admin/tag/_form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 8 |
9 |
10 | 11 |
12 | 15 |
16 | 18 |
19 |
20 | 21 |
22 | 25 |
26 | 30 |
31 |
32 | 33 |
34 | 37 |
38 | 40 |
41 |
42 | 43 |
44 | 47 |
48 | 50 |
51 |
52 | 53 |
54 | 57 |
58 | 64 | 69 |
70 |
-------------------------------------------------------------------------------- /resources/assets/less/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /resources/views/admin/tag/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |

Tags » Listing

8 |
9 | 14 |
15 | 16 |
17 |
18 | 19 | @include('admin.partials.errors') 20 | @include('admin.partials.success') 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | @foreach ($tags as $tag) 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 51 | 57 | 58 | @endforeach 59 | 60 |
TagTitlePage ImageMeta DescriptionLayoutActions
{{ $tag->tag }}{{ $tag->title }}{{ $tag->page_image }}{{ $tag->meta_description }}{{ $tag->layout }} 52 | 54 | Edit 55 | 56 |
61 |
62 |
63 |
64 | @stop 65 | 66 | @section('scripts') 67 | 73 | @stop -------------------------------------------------------------------------------- /app/Services/RssFeed.php: -------------------------------------------------------------------------------- 1 | buildRssData(); 25 | Cache::add('rss-feed', $rss, 120); 26 | return $rss; 27 | } 28 | 29 | /** 30 | * Return a string with the feed data 31 | * 32 | * @return string 33 | */ 34 | protected function buildRssData() 35 | { 36 | $now = Carbon::now(); 37 | $feed = new Feed(); 38 | $channel = new Channel(); 39 | $channel 40 | ->title(config('blog.title')) 41 | ->description(config('blog.description')) 42 | ->url(url()) 43 | ->language('en') 44 | ->copyright('Copyright (c) '.config('blog.author')) 45 | ->lastBuildDate($now->timestamp) 46 | ->appendTo($feed); 47 | 48 | $posts = Post::where('published_at', '<=', $now) 49 | ->where('is_draft', 0) 50 | ->orderBy('published_at', 'desc') 51 | ->take(config('blog.rss_size')) 52 | ->get(); 53 | foreach ($posts as $post) { 54 | $item = new Item(); 55 | $item 56 | ->title($post->title) 57 | ->description($post->subtitle) 58 | ->url($post->url()) 59 | ->pubDate($post->published_at->timestamp) 60 | ->guid($post->url(), true) 61 | ->appendTo($channel); 62 | } 63 | 64 | $feed = (string)$feed; 65 | 66 | // Replace a couple items to make the feed more compliant 67 | $feed = str_replace( 68 | '', 69 | '', 70 | $feed 71 | ); 72 | $feed = str_replace( 73 | '', 74 | ''."\n".' ', 76 | $feed 77 | ); 78 | 79 | return $feed; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | z-index: 3; 44 | color: @pagination-hover-color; 45 | background-color: @pagination-hover-bg; 46 | border-color: @pagination-hover-border; 47 | } 48 | } 49 | 50 | > .active > a, 51 | > .active > span { 52 | &, 53 | &:hover, 54 | &:focus { 55 | z-index: 2; 56 | color: @pagination-active-color; 57 | background-color: @pagination-active-bg; 58 | border-color: @pagination-active-border; 59 | cursor: default; 60 | } 61 | } 62 | 63 | > .disabled { 64 | > span, 65 | > span:hover, 66 | > span:focus, 67 | > a, 68 | > a:hover, 69 | > a:focus { 70 | color: @pagination-disabled-color; 71 | background-color: @pagination-disabled-bg; 72 | border-color: @pagination-disabled-border; 73 | cursor: @cursor-disabled; 74 | } 75 | } 76 | } 77 | 78 | // Sizing 79 | // -------------------------------------------------- 80 | 81 | // Large 82 | .pagination-lg { 83 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); 84 | } 85 | 86 | // Small 87 | .pagination-sm { 88 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); 89 | } 90 | -------------------------------------------------------------------------------- /resources/views/admin/post/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layout') 2 | 3 | @section('styles') 4 | 5 | 6 | 7 | 8 | 9 | @stop 10 | 11 | @section('content') 12 |
13 |
14 |
15 |

Posts » Add New Post

16 |
17 |
18 | 19 |
20 |
21 |
22 |
23 |

New Post Form

24 |
25 |
26 | 27 | @include('admin.partials.errors') 28 | 29 |
31 | 32 | 33 | @include('admin.post._form') 34 | 35 |
36 |
37 |
38 | 42 |
43 |
44 |
45 | 46 |
47 | 48 |
49 |
50 |
51 |
52 |
53 | 54 | @stop 55 | 56 | @section('scripts') 57 | 58 | 59 | 60 | 61 | 74 | @stop -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .btn, 76 | .dropup > .btn { 77 | > .caret { 78 | border-top-color: #000 !important; 79 | } 80 | } 81 | .label { 82 | border: 1px solid #000; 83 | } 84 | 85 | .table { 86 | border-collapse: collapse !important; 87 | 88 | td, 89 | th { 90 | background-color: #fff !important; 91 | } 92 | } 93 | .table-bordered { 94 | th, 95 | td { 96 | border: 1px solid #ddd !important; 97 | } 98 | } 99 | 100 | // Bootstrap specific changes end 101 | } 102 | -------------------------------------------------------------------------------- /app/Jobs/PostFormFields.php: -------------------------------------------------------------------------------- 1 | '', 26 | 'subtitle' => '', 27 | 'page_image' => '', 28 | 'content' => '', 29 | 'meta_description' => '', 30 | 'is_draft' => "0", 31 | 'publish_date' => '', 32 | 'publish_time' => '', 33 | 'layout' => 'blog.layouts.post', 34 | 'tags' => [], 35 | ]; 36 | 37 | /** 38 | * Create a new command instance. 39 | * 40 | * @param integer $id 41 | */ 42 | public function __construct($id = null) 43 | { 44 | $this->id = $id; 45 | } 46 | 47 | /** 48 | * Execute the command. 49 | * 50 | * @return array of fieldnames => values 51 | */ 52 | public function handle() 53 | { 54 | $fields = $this->fieldList; 55 | 56 | if ($this->id) { 57 | $fields = $this->fieldsFromModel($this->id, $fields); 58 | } else { 59 | $when = Carbon::now()->addHour(); 60 | $fields['publish_date'] = $when->format('M-j-Y'); 61 | $fields['publish_time'] = $when->format('g:i A'); 62 | } 63 | 64 | foreach ($fields as $fieldName => $fieldValue) { 65 | $fields[$fieldName] = old($fieldName, $fieldValue); 66 | } 67 | 68 | return array_merge( 69 | $fields, 70 | ['allTags' => Tag::lists('tag')->all()] 71 | ); 72 | } 73 | 74 | /** 75 | * Return the field values from the model 76 | * 77 | * @param integer $id 78 | * @param array $fields 79 | * @return array 80 | */ 81 | protected function fieldsFromModel($id, array $fields) 82 | { 83 | $post = Post::findOrFail($id); 84 | 85 | $fieldNames = array_keys(array_except($fields, ['tags'])); 86 | 87 | $fields = ['id' => $id]; 88 | foreach ($fieldNames as $field) { 89 | $fields[$field] = $post->{$field}; 90 | } 91 | 92 | $fields['tags'] = $post->tags()->lists('tag')->all(); 93 | 94 | return $fields; 95 | } 96 | } -------------------------------------------------------------------------------- /config/auth.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::class, 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 | -------------------------------------------------------------------------------- /app/Jobs/BlogIndexData.php: -------------------------------------------------------------------------------- 1 | tag = $tag; 22 | } 23 | 24 | /** 25 | * Execute the command. 26 | * 27 | * @return array 28 | */ 29 | public function handle() 30 | { 31 | if ($this->tag) { 32 | return $this->tagIndexData($this->tag); 33 | } 34 | 35 | return $this->normalIndexData(); 36 | } 37 | 38 | /** 39 | * Return data for normal index page 40 | * 41 | * @return array 42 | */ 43 | protected function normalIndexData() 44 | { 45 | $posts = Post::with('tags') 46 | ->where('published_at', '<=', Carbon::now()) 47 | ->where('is_draft', 0) 48 | ->orderBy('published_at', 'desc') 49 | ->simplePaginate(config('blog.posts_per_page')); 50 | 51 | return [ 52 | 'title' => config('blog.title'), 53 | 'subtitle' => config('blog.subtitle'), 54 | 'posts' => $posts, 55 | 'page_image' => config('blog.page_image'), 56 | 'meta_description' => config('blog.description'), 57 | 'reverse_direction' => false, 58 | 'tag' => null, 59 | ]; 60 | } 61 | 62 | /** 63 | * Return data for a tag index page 64 | * 65 | * @param string $tag 66 | * @return array 67 | */ 68 | protected function tagIndexData($tag) 69 | { 70 | $tag = Tag::where('tag', $tag)->firstOrFail(); 71 | $reverse_direction = (bool)$tag->reverse_direction; 72 | 73 | $posts = Post::where('published_at', '<=', Carbon::now()) 74 | ->whereHas('tags', function ($q) use ($tag) { 75 | $q->where('tag', '=', $tag->tag); 76 | }) 77 | ->where('is_draft', 0) 78 | ->orderBy('published_at', $reverse_direction ? 'asc' : 'desc') 79 | ->simplePaginate(config('blog.posts_per_page')); 80 | $posts->addQuery('tag', $tag->tag); 81 | 82 | $page_image = $tag->page_image ?: config('blog.page_image'); 83 | 84 | return [ 85 | 'title' => $tag->title, 86 | 'subtitle' => $tag->subtitle, 87 | 'posts' => $posts, 88 | 'page_image' => $page_image, 89 | 'tag' => $tag, 90 | 'reverse_direction' => $reverse_direction, 91 | 'meta_description' => $tag->meta_description ?: config('blog.description'), 92 | ]; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/PostController.php: -------------------------------------------------------------------------------- 1 | withPosts(Post::all()); 21 | } 22 | 23 | /** 24 | * Show the new post form 25 | */ 26 | public function create() 27 | { 28 | $data = $this->dispatch(new PostFormFields()); 29 | 30 | return view('admin.post.create', $data); 31 | } 32 | 33 | /** 34 | * Store a newly created Post 35 | * 36 | * @param PostCreateRequest $request 37 | */ 38 | public function store(PostCreateRequest $request) 39 | { 40 | $post = Post::create($request->postFillData()); 41 | $post->syncTags($request->get('tags', [])); 42 | 43 | return redirect() 44 | ->route('admin.post.index') 45 | ->withSuccess('New Post Successfully Created.'); 46 | } 47 | 48 | /** 49 | * Show the post edit form 50 | * 51 | * @param int $id 52 | * @return Response 53 | */ 54 | public function edit($id) 55 | { 56 | $data = $this->dispatch(new PostFormFields($id)); 57 | 58 | return view('admin.post.edit', $data); 59 | } 60 | 61 | /** 62 | * Update the Post 63 | * 64 | * @param PostUpdateRequest $request 65 | * @param int $id 66 | */ 67 | public function update(PostUpdateRequest $request, $id) 68 | { 69 | $post = Post::findOrFail($id); 70 | $post->fill($request->postFillData()); 71 | $post->save(); 72 | $post->syncTags($request->get('tags', [])); 73 | 74 | if ($request->action === 'continue') { 75 | return redirect() 76 | ->back() 77 | ->withSuccess('Post saved.'); 78 | } 79 | 80 | return redirect() 81 | ->route('admin.post.index') 82 | ->withSuccess('Post saved.'); 83 | } 84 | 85 | /** 86 | * Remove the specified resource from storage. 87 | * 88 | * @param int $id 89 | * @return Response 90 | */ 91 | public function destroy($id) 92 | { 93 | $post = Post::findOrFail($id); 94 | $post->tags()->detach(); 95 | $post->delete(); 96 | 97 | return redirect() 98 | ->route('admin.post.index') 99 | ->withSuccess('Post deleted.'); 100 | } 101 | } -------------------------------------------------------------------------------- /resources/views/blog/partials/page-footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | @include('blog.partials.disqus') 5 |
6 |
7 |
8 | 73 | -------------------------------------------------------------------------------- /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' => public_path('uploads'), 49 | ], 50 | 51 | 'ftp' => [ 52 | 'driver' => 'ftp', 53 | 'host' => 'ftp.example.com', 54 | 'username' => 'your-username', 55 | 'password' => 'your-password', 56 | 57 | // Optional FTP Settings... 58 | // 'port' => 21, 59 | // 'root' => '', 60 | // 'passive' => true, 61 | // 'ssl' => true, 62 | // 'timeout' => 30, 63 | ], 64 | 65 | 's3' => [ 66 | 'driver' => 's3', 67 | 'key' => env('AWS_KEY'), 68 | 'secret' => env('AWS_SECRET'), 69 | 'region' => env('AWS_REGION'), 70 | 'bucket' => env('AWS_BUCKET'), 71 | ], 72 | 73 | 'rackspace' => [ 74 | 'driver' => 'rackspace', 75 | 'username' => 'your-username', 76 | 'key' => 'your-key', 77 | 'container' => 'your-container', 78 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 79 | 'region' => 'IAD', 80 | 'url_type' => 'publicURL', 81 | ], 82 | 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /resources/views/blog/layouts/post.blade.php: -------------------------------------------------------------------------------- 1 | @extends('blog.layouts.master', [ 2 | 'title' => $post->title, 3 | 'meta_description' => $post->meta_description ?: config('blog.description'), 4 | ]) 5 | 6 | @section('page-header') 7 |
9 |
10 |
11 |
12 |
13 |

{{ $post->title }}

14 |

{{ $post->subtitle }}

15 | 16 | Posted on {{ $post->published_at->format('F j, Y') }} 17 | @if ($post->tags->count()) 18 | in 19 | {!! join(', ', $post->tagLinks()) !!} 20 | @endif 21 | 22 |
23 |
24 |
25 |
26 |
27 | @stop 28 | 29 | @section('content') 30 | 31 | {{-- The Post --}} 32 |
33 |
34 |
35 |
36 | {!! $post->content_html !!} 37 |
38 |
39 |
40 |
41 | 42 | {{-- The Pager --}} 43 |
44 |
45 | 82 |
83 | 84 |
85 | @stop 86 | -------------------------------------------------------------------------------- /resources/views/blog/contact.blade.php: -------------------------------------------------------------------------------- 1 | @extends('blog.layouts.master', ['meta_description' => 'Contact Form']) 2 | 3 | @section('page-header') 4 |
6 |
7 |
8 |
9 |
10 |

Contact Me

11 |
12 |

13 | Have questions? I have answers (maybe). 14 |

15 |
16 |
17 |
18 |
19 |
20 | @stop 21 | 22 | @section('content') 23 |
24 |
25 |
26 | @include('admin.partials.errors') 27 | @include('admin.partials.success') 28 |

29 | Want to get in touch with me? Fill out the form below to send me a 30 | message and I will try to get back to you within 24 hours! 31 |

32 |
33 | 34 |
35 |
36 | 37 | 39 |
40 |
41 |
42 |
43 | 44 | 46 |
47 |
48 |
49 |
50 | 51 | 53 |
54 |
55 |
56 |
57 | 58 | 60 |
61 |
62 |
63 |
64 |
65 | 66 |
67 |
68 |
69 |
70 |
71 |
72 | @endsection 73 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. ` 25 | 26 | 27 | 28 |
29 | 30 |
31 |

{{ $tag }}

32 |
33 |
34 | 35 | @include('admin.tag._form') 36 | 37 |
38 |
39 | 43 | 48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | {{-- Confirm Delete --}} 60 | 89 | 90 | @stop -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/tooltip.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tooltips 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .tooltip { 8 | position: absolute; 9 | z-index: @zindex-tooltip; 10 | display: block; 11 | // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. 12 | // So reset our font and text properties to avoid inheriting weird values. 13 | .reset-text(); 14 | font-size: @font-size-small; 15 | 16 | .opacity(0); 17 | 18 | &.in { .opacity(@tooltip-opacity); } 19 | &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } 20 | &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } 21 | &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; } 22 | &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; } 23 | } 24 | 25 | // Wrapper for the tooltip content 26 | .tooltip-inner { 27 | max-width: @tooltip-max-width; 28 | padding: 3px 8px; 29 | color: @tooltip-color; 30 | text-align: center; 31 | background-color: @tooltip-bg; 32 | border-radius: @border-radius-base; 33 | } 34 | 35 | // Arrows 36 | .tooltip-arrow { 37 | position: absolute; 38 | width: 0; 39 | height: 0; 40 | border-color: transparent; 41 | border-style: solid; 42 | } 43 | // Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1 44 | .tooltip { 45 | &.top .tooltip-arrow { 46 | bottom: 0; 47 | left: 50%; 48 | margin-left: -@tooltip-arrow-width; 49 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 50 | border-top-color: @tooltip-arrow-color; 51 | } 52 | &.top-left .tooltip-arrow { 53 | bottom: 0; 54 | right: @tooltip-arrow-width; 55 | margin-bottom: -@tooltip-arrow-width; 56 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 57 | border-top-color: @tooltip-arrow-color; 58 | } 59 | &.top-right .tooltip-arrow { 60 | bottom: 0; 61 | left: @tooltip-arrow-width; 62 | margin-bottom: -@tooltip-arrow-width; 63 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 64 | border-top-color: @tooltip-arrow-color; 65 | } 66 | &.right .tooltip-arrow { 67 | top: 50%; 68 | left: 0; 69 | margin-top: -@tooltip-arrow-width; 70 | border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0; 71 | border-right-color: @tooltip-arrow-color; 72 | } 73 | &.left .tooltip-arrow { 74 | top: 50%; 75 | right: 0; 76 | margin-top: -@tooltip-arrow-width; 77 | border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width; 78 | border-left-color: @tooltip-arrow-color; 79 | } 80 | &.bottom .tooltip-arrow { 81 | top: 0; 82 | left: 50%; 83 | margin-left: -@tooltip-arrow-width; 84 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 85 | border-bottom-color: @tooltip-arrow-color; 86 | } 87 | &.bottom-left .tooltip-arrow { 88 | top: 0; 89 | right: @tooltip-arrow-width; 90 | margin-top: -@tooltip-arrow-width; 91 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 92 | border-bottom-color: @tooltip-arrow-color; 93 | } 94 | &.bottom-right .tooltip-arrow { 95 | top: 0; 96 | left: @tooltip-arrow-width; 97 | margin-top: -@tooltip-arrow-width; 98 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 99 | border-bottom-color: @tooltip-arrow-color; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/grid.less: -------------------------------------------------------------------------------- 1 | // Grid system 2 | // 3 | // Generate semantic grid columns with these mixins. 4 | 5 | // Centered container element 6 | .container-fixed(@gutter: @grid-gutter-width) { 7 | margin-right: auto; 8 | margin-left: auto; 9 | padding-left: (@gutter / 2); 10 | padding-right: (@gutter / 2); 11 | &:extend(.clearfix all); 12 | } 13 | 14 | // Creates a wrapper for a series of columns 15 | .make-row(@gutter: @grid-gutter-width) { 16 | margin-left: ceil((@gutter / -2)); 17 | margin-right: floor((@gutter / -2)); 18 | &:extend(.clearfix all); 19 | } 20 | 21 | // Generate the extra small columns 22 | .make-xs-column(@columns; @gutter: @grid-gutter-width) { 23 | position: relative; 24 | float: left; 25 | width: percentage((@columns / @grid-columns)); 26 | min-height: 1px; 27 | padding-left: (@gutter / 2); 28 | padding-right: (@gutter / 2); 29 | } 30 | .make-xs-column-offset(@columns) { 31 | margin-left: percentage((@columns / @grid-columns)); 32 | } 33 | .make-xs-column-push(@columns) { 34 | left: percentage((@columns / @grid-columns)); 35 | } 36 | .make-xs-column-pull(@columns) { 37 | right: percentage((@columns / @grid-columns)); 38 | } 39 | 40 | // Generate the small columns 41 | .make-sm-column(@columns; @gutter: @grid-gutter-width) { 42 | position: relative; 43 | min-height: 1px; 44 | padding-left: (@gutter / 2); 45 | padding-right: (@gutter / 2); 46 | 47 | @media (min-width: @screen-sm-min) { 48 | float: left; 49 | width: percentage((@columns / @grid-columns)); 50 | } 51 | } 52 | .make-sm-column-offset(@columns) { 53 | @media (min-width: @screen-sm-min) { 54 | margin-left: percentage((@columns / @grid-columns)); 55 | } 56 | } 57 | .make-sm-column-push(@columns) { 58 | @media (min-width: @screen-sm-min) { 59 | left: percentage((@columns / @grid-columns)); 60 | } 61 | } 62 | .make-sm-column-pull(@columns) { 63 | @media (min-width: @screen-sm-min) { 64 | right: percentage((@columns / @grid-columns)); 65 | } 66 | } 67 | 68 | // Generate the medium columns 69 | .make-md-column(@columns; @gutter: @grid-gutter-width) { 70 | position: relative; 71 | min-height: 1px; 72 | padding-left: (@gutter / 2); 73 | padding-right: (@gutter / 2); 74 | 75 | @media (min-width: @screen-md-min) { 76 | float: left; 77 | width: percentage((@columns / @grid-columns)); 78 | } 79 | } 80 | .make-md-column-offset(@columns) { 81 | @media (min-width: @screen-md-min) { 82 | margin-left: percentage((@columns / @grid-columns)); 83 | } 84 | } 85 | .make-md-column-push(@columns) { 86 | @media (min-width: @screen-md-min) { 87 | left: percentage((@columns / @grid-columns)); 88 | } 89 | } 90 | .make-md-column-pull(@columns) { 91 | @media (min-width: @screen-md-min) { 92 | right: percentage((@columns / @grid-columns)); 93 | } 94 | } 95 | 96 | // Generate the large columns 97 | .make-lg-column(@columns; @gutter: @grid-gutter-width) { 98 | position: relative; 99 | min-height: 1px; 100 | padding-left: (@gutter / 2); 101 | padding-right: (@gutter / 2); 102 | 103 | @media (min-width: @screen-lg-min) { 104 | float: left; 105 | width: percentage((@columns / @grid-columns)); 106 | } 107 | } 108 | .make-lg-column-offset(@columns) { 109 | @media (min-width: @screen-lg-min) { 110 | margin-left: percentage((@columns / @grid-columns)); 111 | } 112 | } 113 | .make-lg-column-push(@columns) { 114 | @media (min-width: @screen-lg-min) { 115 | left: percentage((@columns / @grid-columns)); 116 | } 117 | } 118 | .make-lg-column-pull(@columns) { 119 | @media (min-width: @screen-lg-min) { 120 | right: percentage((@columns / @grid-columns)); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // 8 | // Easily usable on
    ,
      , or
      . 9 | 10 | .list-group { 11 | // No need to set list-style: none; since .list-group-item is block level 12 | margin-bottom: 20px; 13 | padding-left: 0; // reset padding because ul and ol 14 | } 15 | 16 | 17 | // Individual list items 18 | // 19 | // Use on `li`s or `div`s within the `.list-group` parent. 20 | 21 | .list-group-item { 22 | position: relative; 23 | display: block; 24 | padding: 10px 15px; 25 | // Place the border on the list items and negative margin up for better styling 26 | margin-bottom: -1px; 27 | background-color: @list-group-bg; 28 | border: 1px solid @list-group-border; 29 | 30 | // Round the first and last items 31 | &:first-child { 32 | .border-top-radius(@list-group-border-radius); 33 | } 34 | &:last-child { 35 | margin-bottom: 0; 36 | .border-bottom-radius(@list-group-border-radius); 37 | } 38 | } 39 | 40 | 41 | // Interactive list items 42 | // 43 | // Use anchor or button elements instead of `li`s or `div`s to create interactive items. 44 | // Includes an extra `.active` modifier class for showing selected items. 45 | 46 | a.list-group-item, 47 | button.list-group-item { 48 | color: @list-group-link-color; 49 | 50 | .list-group-item-heading { 51 | color: @list-group-link-heading-color; 52 | } 53 | 54 | // Hover state 55 | &:hover, 56 | &:focus { 57 | text-decoration: none; 58 | color: @list-group-link-hover-color; 59 | background-color: @list-group-hover-bg; 60 | } 61 | } 62 | 63 | button.list-group-item { 64 | width: 100%; 65 | text-align: left; 66 | } 67 | 68 | .list-group-item { 69 | // Disabled state 70 | &.disabled, 71 | &.disabled:hover, 72 | &.disabled:focus { 73 | background-color: @list-group-disabled-bg; 74 | color: @list-group-disabled-color; 75 | cursor: @cursor-disabled; 76 | 77 | // Force color to inherit for custom content 78 | .list-group-item-heading { 79 | color: inherit; 80 | } 81 | .list-group-item-text { 82 | color: @list-group-disabled-text-color; 83 | } 84 | } 85 | 86 | // Active class on item itself, not parent 87 | &.active, 88 | &.active:hover, 89 | &.active:focus { 90 | z-index: 2; // Place active items above their siblings for proper border styling 91 | color: @list-group-active-color; 92 | background-color: @list-group-active-bg; 93 | border-color: @list-group-active-border; 94 | 95 | // Force color to inherit for custom content 96 | .list-group-item-heading, 97 | .list-group-item-heading > small, 98 | .list-group-item-heading > .small { 99 | color: inherit; 100 | } 101 | .list-group-item-text { 102 | color: @list-group-active-text-color; 103 | } 104 | } 105 | } 106 | 107 | 108 | // Contextual variants 109 | // 110 | // Add modifier classes to change text and background color on individual items. 111 | // Organizationally, this must come after the `:hover` states. 112 | 113 | .list-group-item-variant(success; @state-success-bg; @state-success-text); 114 | .list-group-item-variant(info; @state-info-bg; @state-info-text); 115 | .list-group-item-variant(warning; @state-warning-bg; @state-warning-text); 116 | .list-group-item-variant(danger; @state-danger-bg; @state-danger-text); 117 | 118 | 119 | // Custom content options 120 | // 121 | // Extra classes for creating well-formatted content within `.list-group-item`s. 122 | 123 | .list-group-item-heading { 124 | margin-top: 0; 125 | margin-bottom: 5px; 126 | } 127 | .list-group-item-text { 128 | margin-bottom: 0; 129 | line-height: 1.3; 130 | } 131 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/UploadController.php: -------------------------------------------------------------------------------- 1 | manager = $manager; 19 | } 20 | 21 | /** 22 | * Show page of files / subfolders 23 | */ 24 | public function index(Request $request) 25 | { 26 | $folder = $request->get('folder'); 27 | $data = $this->manager->folderInfo($folder); 28 | 29 | return view('admin.upload.index', $data); 30 | } 31 | 32 | /** 33 | * Create a new folder 34 | */ 35 | public function createFolder(UploadNewFolderRequest $request) 36 | { 37 | $new_folder = $request->get('new_folder'); 38 | $folder = $request->get('folder').'/'.$new_folder; 39 | 40 | $result = $this->manager->createDirectory($folder); 41 | 42 | if ($result === true) { 43 | return redirect() 44 | ->back() 45 | ->withSuccess("Folder '$new_folder' created."); 46 | } 47 | 48 | $error = $result ? : "An error occurred creating directory."; 49 | return redirect() 50 | ->back() 51 | ->withErrors([$error]); 52 | } 53 | 54 | /** 55 | * Delete a file 56 | */ 57 | public function deleteFile(Request $request) 58 | { 59 | $del_file = $request->get('del_file'); 60 | $path = $request->get('folder').'/'.$del_file; 61 | 62 | $result = $this->manager->deleteFile($path); 63 | 64 | if ($result === true) { 65 | return redirect() 66 | ->back() 67 | ->withSuccess("File '$del_file' deleted."); 68 | } 69 | 70 | $error = $result ? : "An error occurred deleting file."; 71 | return redirect() 72 | ->back() 73 | ->withErrors([$error]); 74 | } 75 | 76 | /** 77 | * Delete a folder 78 | */ 79 | public function deleteFolder(Request $request) 80 | { 81 | $del_folder = $request->get('del_folder'); 82 | $folder = $request->get('folder').'/'.$del_folder; 83 | 84 | $result = $this->manager->deleteDirectory($folder); 85 | 86 | if ($result === true) { 87 | return redirect() 88 | ->back() 89 | ->withSuccess("Folder '$del_folder' deleted."); 90 | } 91 | 92 | $error = $result ? : "An error occurred deleting directory."; 93 | return redirect() 94 | ->back() 95 | ->withErrors([$error]); 96 | } 97 | 98 | /** 99 | * Upload new file 100 | */ 101 | public function uploadFile(UploadFileRequest $request) 102 | { 103 | $file = $_FILES['file']; 104 | $fileName = $request->get('file_name'); 105 | $fileName = $fileName ?: $file['name']; 106 | $path = str_finish($request->get('folder'), '/') . $fileName; 107 | $content = File::get($file['tmp_name']); 108 | 109 | $result = $this->manager->saveFile($path, $content); 110 | 111 | if ($result === true) { 112 | return redirect() 113 | ->back() 114 | ->withSuccess("File '$fileName' uploaded."); 115 | } 116 | 117 | $error = $result ? : "An error occurred uploading file."; 118 | return redirect() 119 | ->back() 120 | ->withErrors([$error]); 121 | } 122 | } 123 | --------------------------------------------------------------------------------