├── .env.example ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SCREENSHOTS.md ├── app ├── Console │ └── Kernel.php ├── Facades │ ├── CommentRepository.php │ ├── EventRepository.php │ ├── NavigationFactory.php │ ├── PageRepository.php │ └── PostRepository.php ├── Http │ ├── Controllers │ │ ├── AbstractController.php │ │ ├── CommentController.php │ │ ├── EventController.php │ │ ├── PageController.php │ │ └── PostController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Auth │ │ │ ├── Blog.php │ │ │ └── Edit.php │ │ └── CheckForMaintenanceMode.php │ ├── Requests │ │ └── .gitkeep │ ├── filters.php │ └── routes.php ├── Models │ ├── Comment.php │ ├── Event.php │ ├── Page.php │ ├── Post.php │ ├── Relations │ │ ├── BelongsToPostTrait.php │ │ ├── HasManyCommentsTrait.php │ │ ├── HasManyEventsTrait.php │ │ ├── HasManyPagesTrait.php │ │ └── HasManyPostsTrait.php │ └── User.php ├── Navigation │ └── Factory.php ├── Observers │ └── PageObserver.php ├── Presenters │ ├── CommentPresenter.php │ ├── ContentPresenterTrait.php │ ├── EventPresenter.php │ ├── OwnerPresenterTrait.php │ ├── PagePresenter.php │ ├── PostPresenter.php │ ├── RevisionDisplayers │ │ ├── AbstractRevisionDisplayer.php │ │ ├── Comment │ │ │ ├── AbstractDisplayer.php │ │ │ ├── BodyDisplayer.php │ │ │ ├── CreatedAtDisplayer.php │ │ │ └── DeletedAtDisplayer.php │ │ ├── Event │ │ │ ├── AbstractDisplayer.php │ │ │ ├── BodyDisplayer.php │ │ │ ├── CreatedAtDisplayer.php │ │ │ ├── DateDisplayer.php │ │ │ ├── DeletedAtDisplayer.php │ │ │ ├── LocationDisplayer.php │ │ │ └── TitleDisplayer.php │ │ ├── Page │ │ │ ├── AbstractDisplayer.php │ │ │ ├── BodyDisplayer.php │ │ │ ├── CreatedAtDisplayer.php │ │ │ ├── CssDisplayer.php │ │ │ ├── DeletedAtDisplayer.php │ │ │ ├── IconDisplayer.php │ │ │ ├── JsDisplayer.php │ │ │ ├── NavTitleDisplayer.php │ │ │ ├── ShowNavDisplayer.php │ │ │ ├── ShowTitleDisplayer.php │ │ │ ├── SlugDisplayer.php │ │ │ └── TitleDisplayer.php │ │ └── Post │ │ │ ├── AbstractDisplayer.php │ │ │ ├── BodyDisplayer.php │ │ │ ├── CreatedAtDisplayer.php │ │ │ ├── DeletedAtDisplayer.php │ │ │ ├── SummaryDisplayer.php │ │ │ └── TitleDisplayer.php │ └── UserPresenter.php ├── Providers │ ├── AppServiceProvider.php │ └── RouteServiceProvider.php ├── Repositories │ ├── CommentRepository.php │ ├── EventRepository.php │ ├── PageRepository.php │ └── PostRepository.php ├── Seeds │ ├── CommentsTableSeeder.php │ ├── EventsTableSeeder.php │ ├── GroupsTableSeeder.php │ ├── PagesTableSeeder.php │ ├── PostsTableSeeder.php │ ├── UsersGroupsTableSeeder.php │ ├── UsersTableSeeder.php │ ├── page-about.stub │ ├── page-contact.stub │ └── page-home.stub └── Subscribers │ ├── CommandSubscriber.php │ └── NavigationSubscriber.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── analytics.php ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cloudflare.php ├── cms.php ├── compile.php ├── contact.php ├── credentials.php ├── database.php ├── date.php ├── exceptions.php ├── filesystems.php ├── htmlmin.php ├── logviewer.php ├── mail.php ├── markdown.php ├── queue.php ├── security.php ├── sentry.php ├── services.php ├── session.php ├── theme.php ├── throttle.php ├── trustedproxy.php └── view.php ├── database ├── .gitignore ├── migrations │ ├── 2012_12_06_225921_migration_cartalyst_sentry_install_users.php │ ├── 2012_12_06_225929_migration_cartalyst_sentry_install_groups.php │ ├── 2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php │ ├── 2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php │ ├── 2014_07_19_093020_update_users_table.php │ ├── 2014_07_19_093021_update_groups_table.php │ ├── 2014_07_19_093030_create_revisions_table.php │ ├── 2014_07_19_110721_create_pages_table.php │ ├── 2014_07_19_110722_create_posts_table.php │ ├── 2014_07_19_110723_create_comments_table.php │ └── 2014_07_19_110724_create_events_table.php └── seeds │ └── DatabaseSeeder.php ├── gulpfile.js ├── package.json ├── phpunit.xml.dist ├── public ├── .htaccess ├── assets │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── scripts │ │ └── .gitignore │ └── styles │ │ └── .gitignore ├── favicon.ico ├── index.php ├── packages │ └── .gitignore └── robots.txt ├── resources ├── assets │ ├── css │ │ ├── BOOTSTRAP-LICENSE │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.cerulean.min.css │ │ ├── bootstrap.cosmo.min.css │ │ ├── bootstrap.cyborg.min.css │ │ ├── bootstrap.darkly.min.css │ │ ├── bootstrap.flatly.min.css │ │ ├── bootstrap.journal.min.css │ │ ├── bootstrap.lumen.min.css │ │ ├── bootstrap.min.css │ │ ├── bootstrap.paper.min.css │ │ ├── bootstrap.readable.min.css │ │ ├── bootstrap.sandstone.min.css │ │ ├── bootstrap.simplex.min.css │ │ ├── bootstrap.slate.min.css │ │ ├── bootstrap.spacelab.min.css │ │ ├── bootstrap.superhero.min.css │ │ ├── bootstrap.united.min.css │ │ ├── bootstrap.yeti.min.css │ │ └── cms-main.css │ └── js │ │ ├── cms-alerts.js │ │ ├── cms-carousel.js │ │ ├── cms-comment-core.js │ │ ├── cms-comment-create.js │ │ ├── cms-comment-delete.js │ │ ├── cms-comment-edit.js │ │ ├── cms-comment-fetch.js │ │ ├── cms-comment-main.js │ │ ├── cms-picker.js │ │ ├── cms-restfulizer.js │ │ └── cms-timeago.js ├── lang │ └── en │ │ ├── auth.php │ │ ├── messages.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── events │ ├── create.blade.php │ ├── delete.blade.php │ ├── deletes.blade.php │ ├── edit.blade.php │ ├── form.blade.php │ ├── index.blade.php │ └── show.blade.php │ ├── layouts │ ├── default.blade.php │ └── email.blade.php │ ├── maintenance.blade.php │ ├── pages │ ├── create.blade.php │ ├── delete.blade.php │ ├── edit.blade.php │ ├── form.blade.php │ └── show.blade.php │ ├── partials │ ├── analytics.blade.php │ ├── footer.blade.php │ ├── header.blade.php │ ├── notifications.blade.php │ └── title.blade.php │ ├── posts │ ├── comment.blade.php │ ├── create.blade.php │ ├── delete.blade.php │ ├── deletes.blade.php │ ├── edit.blade.php │ ├── form.blade.php │ ├── index.blade.php │ └── show.blade.php │ └── vendor │ └── navigation │ └── bootstrap.blade.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── AbstractTestCase.php ├── Acceptance ├── AbstractTestCase.php ├── CommentTest.php └── PageTest.php ├── BasicTest.php ├── Facades ├── CommentRepositoryTest.php ├── EventRepositoryTest.php ├── NavigationFactoryTest.php ├── PageRepositoryTest.php └── PostRepositoryTest.php ├── Functional └── CommandTest.php └── ServiceProviderTest.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=false 3 | APP_URL=http://localhost 4 | APP_KEY=SomeRandomString 5 | APP_NAME=Bootstrap CMS 6 | APP_TIMEZONE=UTC 7 | APP_LOCALE=en 8 | APP_LOG=daily 9 | 10 | CMS_DESC=Bootstrap CMS is a PHP CMS powered by Laravel 5. 11 | CMS_AUTHOR=Graham Campbell 12 | CMS_NAV=email 13 | CMS_EVAL=true 14 | CMS_BLOGGING=true 15 | CMS_EVENTS=true 16 | 17 | CONTACT_EMAIL=admin@example.com 18 | 19 | CRED_REG=true 20 | CRED_ACTIVATION=true 21 | 22 | DB_HOST=localhost 23 | DB_CONNECTION=mysql 24 | DB_DATABASE=homestead 25 | DB_USERNAME=homestead 26 | DB_PASSWORD=secret 27 | 28 | CACHE_DRIVER=file 29 | SESSION_DRIVER=file 30 | QUEUE_DRIVER=sync 31 | 32 | MAIL_DRIVER=smtp 33 | MAIL_HOST=smtp.mailgun.org 34 | MAIL_PORT=587 35 | MAIL_USERNAME=null 36 | MAIL_PASSWORD=null 37 | MAIL_ENCRYPTION=null 38 | MAIL_FROM_ADDRESS=null 39 | MAIL_FROM_NAME=null 40 | 41 | THEME_NAME=default 42 | THEME_INVERSE=true 43 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | phpunit.xml 3 | vendor 4 | node_modules 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.5.9 5 | - 5.5 6 | - 5.6 7 | - 7.0 8 | - hhvm 9 | 10 | sudo: false 11 | 12 | install: 13 | - travis_retry composer install --no-interaction --prefer-source 14 | - travis_retry npm install 15 | 16 | before_script: 17 | - travis_retry php artisan vendor:publish 18 | - travis_retry gulp --production 19 | 20 | script: 21 | - if [ "$TRAVIS_PHP_VERSION" != "5.5.9" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; fi 22 | - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi 23 | 24 | after_script: 25 | - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi 26 | - if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi 27 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | CONTRIBUTING 2 | ============ 3 | 4 | 5 | Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests. 6 | 7 | 8 | ## Guidelines 9 | 10 | * Please follow the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PHP-FIG Naming Conventions](https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md). 11 | * Ensure that the current tests pass, and if you've added something new, add the tests where relevant. 12 | * Remember that we follow [SemVer](http://semver.org). If you are changing the behaviour, or the public api, you may need to update the docs. 13 | * Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](http://git-scm.com/book/en/Git-Tools-Rewriting-History) them before submitting. 14 | * You may also need to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) to avoid merge conflicts. 15 | 16 | 17 | ## Running Tests 18 | 19 | You will need an install of [Composer](https://getcomposer.org) before continuing. 20 | 21 | First, install the dependencies: 22 | 23 | ```bash 24 | $ composer install 25 | ``` 26 | 27 | Then run phpunit: 28 | 29 | ```bash 30 | $ vendor/bin/phpunit 31 | ``` 32 | 33 | If the test suite passes on your local machine you should be good to go. 34 | 35 | When you make a pull request, the tests will automatically be run again by [Travis CI](https://travis-ci.org/) on multiple php versions and hhvm. 36 | -------------------------------------------------------------------------------- /SCREENSHOTS.md: -------------------------------------------------------------------------------- 1 | SCREENSHOTS 2 | =========== 3 | 4 | 5 | 6 | ## Public Interface 7 | 8 | 9 | ![Public 1](https://i.imgur.com/MxrMS8q.png) 10 | 11 | 12 | ![Public 2](https://i.imgur.com/bWLf446.png) 13 | 14 | 15 | ![Public 3](https://i.imgur.com/NvEmBPI.png) 16 | 17 | 18 | ![Public 4](https://i.imgur.com/JZjZI0W.png) 19 | 20 | 21 | ![Public 5](https://i.imgur.com/KpTEDqa.png) 22 | 23 | 24 | ![Public 6](https://i.imgur.com/Z9ZSfhC.png) 25 | 26 | 27 | ![Public 7](https://i.imgur.com/9mV2Vxa.png) 28 | 29 | 30 | ![Public 8](https://i.imgur.com/gLFxJNj.png) 31 | 32 | 33 | ![Public 9](https://i.imgur.com/vjRMnqO.png) 34 | 35 | 36 | ![Public 10](https://i.imgur.com/Iv9Twb7.png) 37 | 38 | 39 | ![Public 11](https://i.imgur.com/0fd1kdr.png) 40 | 41 | 42 | ![Public 12](https://i.imgur.com/AW5ZZSo.png) 43 | 44 | 45 | 46 | ## Admin Interface 47 | 48 | 49 | ![Admin 1](https://i.imgur.com/oErWJ5P.png) 50 | 51 | 52 | ![Admin 2](https://i.imgur.com/RYyBCoe.png) 53 | 54 | 55 | ![Admin 3](https://i.imgur.com/XVJvIMH.png) 56 | 57 | 58 | ![Admin 4](https://i.imgur.com/AGemd8j.png) 59 | 60 | 61 | ![Admin 5](https://i.imgur.com/o1EhNYS.png) 62 | 63 | 64 | ![Admin 6](https://i.imgur.com/UrY66LZ.png) 65 | 66 | 67 | ![Admin 7](https://i.imgur.com/OjMGUDV.png) 68 | 69 | 70 | ![Admin 8](https://i.imgur.com/BitM9uj.png) 71 | 72 | 73 | ![Admin 9](https://i.imgur.com/M5rQMjt.png) 74 | 75 | 76 | ![Admin 10](https://i.imgur.com/YPZhTCQ.png) 77 | 78 | 79 | ![Admin 11](https://i.imgur.com/IN4gNIk.png) 80 | 81 | 82 | ![Admin 12](https://i.imgur.com/hTQ5LD8.png) 83 | 84 | 85 | ![Admin 13](https://i.imgur.com/P4yCwZR.png) 86 | 87 | 88 | ![Admin 14](https://i.imgur.com/Sh7E1hr.png) 89 | 90 | 91 | ![Admin 15](https://i.imgur.com/OKSg2vw.png) 92 | 93 | 94 | ![Admin 16](https://i.imgur.com/QbirCNL.png) 95 | 96 | 97 | ![Admin 17](https://i.imgur.com/SjsXATC.png) 98 | 99 | 100 | ![Admin 18](https://i.imgur.com/FHPQYGs.png) 101 | 102 | 103 | ![Admin 19](https://i.imgur.com/PWEW3G1.png) 104 | 105 | 106 | ![Admin 20](https://i.imgur.com//7aQchEs.png) 107 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Console; 13 | 14 | use Illuminate\Console\Scheduling\Schedule; 15 | use Illuminate\Foundation\Console\Kernel as ConsoleKernel; 16 | 17 | /** 18 | * This is the console kernel class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class Kernel extends ConsoleKernel 23 | { 24 | /** 25 | * The Artisan commands provided by your application. 26 | * 27 | * @var string[] 28 | */ 29 | protected $commands = []; 30 | 31 | /** 32 | * Define the application's command schedule. 33 | * 34 | * @param \Illuminate\Console\Scheduling\Schedule $schedule 35 | * 36 | * @return void 37 | */ 38 | protected function schedule(Schedule $schedule) 39 | { 40 | // 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Facades/CommentRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Facades; 13 | 14 | use Illuminate\Support\Facades\Facade; 15 | 16 | /** 17 | * This is the comment repository facade class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CommentRepository extends Facade 22 | { 23 | /** 24 | * Get the registered name of the component. 25 | * 26 | * @return string 27 | */ 28 | protected static function getFacadeAccessor() 29 | { 30 | return 'commentrepository'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Facades/EventRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Facades; 13 | 14 | use Illuminate\Support\Facades\Facade; 15 | 16 | /** 17 | * This is the event repository facade class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class EventRepository extends Facade 22 | { 23 | /** 24 | * Get the registered name of the component. 25 | * 26 | * @return string 27 | */ 28 | protected static function getFacadeAccessor() 29 | { 30 | return 'eventrepository'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Facades/NavigationFactory.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Facades; 13 | 14 | use Illuminate\Support\Facades\Facade; 15 | 16 | /** 17 | * This is the navigation factory facade class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class NavigationFactory extends Facade 22 | { 23 | /** 24 | * Get the registered name of the component. 25 | * 26 | * @return string 27 | */ 28 | protected static function getFacadeAccessor() 29 | { 30 | return 'navfactory'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Facades/PageRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Facades; 13 | 14 | use Illuminate\Support\Facades\Facade; 15 | 16 | /** 17 | * This is the page repository facade class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class PageRepository extends Facade 22 | { 23 | /** 24 | * Get the registered name of the component. 25 | * 26 | * @return string 27 | */ 28 | protected static function getFacadeAccessor() 29 | { 30 | return 'pagerepository'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Facades/PostRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Facades; 13 | 14 | use Illuminate\Support\Facades\Facade; 15 | 16 | /** 17 | * This is the post repository facade class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class PostRepository extends Facade 22 | { 23 | /** 24 | * Get the registered name of the component. 25 | * 26 | * @return string 27 | */ 28 | protected static function getFacadeAccessor() 29 | { 30 | return 'postrepository'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/AbstractController.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Http\Controllers; 13 | 14 | use GrahamCampbell\BootstrapCMS\Http\Middleware\Auth\Blog; 15 | use GrahamCampbell\BootstrapCMS\Http\Middleware\Auth\Edit; 16 | use GrahamCampbell\Credentials\Http\Controllers\AbstractController as Controller; 17 | 18 | /** 19 | * This is the abstract controller class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | abstract class AbstractController extends Controller 24 | { 25 | /** 26 | * A list of methods protected by edit permissions. 27 | * 28 | * @var string[] 29 | */ 30 | protected $edits = []; 31 | 32 | /** 33 | * A list of methods protected by blog permissions. 34 | * 35 | * @var string[] 36 | */ 37 | protected $blogs = []; 38 | 39 | /** 40 | * Create a new instance. 41 | * 42 | * @return void 43 | */ 44 | public function __construct() 45 | { 46 | parent::__construct(); 47 | 48 | if ($this->edits) { 49 | $this->middleware(Edit::class, ['only' => $this->edits]); 50 | } 51 | 52 | if ($this->blogs) { 53 | $this->middleware(Blog::class, ['only' => $this->blogs]); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Http; 13 | 14 | use Illuminate\Foundation\Http\Kernel as HttpKernel; 15 | 16 | /** 17 | * This is the http kernel class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class Kernel extends HttpKernel 22 | { 23 | /** 24 | * The application's global HTTP middleware stack. 25 | * 26 | * @var string[] 27 | */ 28 | protected $middleware = [ 29 | 'Fideloper\Proxy\TrustProxies', 30 | 'GrahamCampbell\BootstrapCMS\Http\Middleware\CheckForMaintenanceMode', 31 | 'Illuminate\Cookie\Middleware\EncryptCookies', 32 | 'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse', 33 | 'Illuminate\Session\Middleware\StartSession', 34 | 'Illuminate\View\Middleware\ShareErrorsFromSession', 35 | // 'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken', 36 | ]; 37 | 38 | /** 39 | * The application's route middleware. 40 | * 41 | * @var string[] 42 | */ 43 | protected $routeMiddleware = []; 44 | } 45 | -------------------------------------------------------------------------------- /app/Http/Middleware/Auth/Blog.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Http\Middleware\Auth; 13 | 14 | use GrahamCampbell\Credentials\Http\Middleware\Auth\AbstractAuth; 15 | 16 | /** 17 | * This is the blog auth middleware class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class Blog extends AbstractAuth 22 | { 23 | // clever stuff happens 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Middleware/Auth/Edit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Http\Middleware\Auth; 13 | 14 | use GrahamCampbell\Credentials\Http\Middleware\Auth\AbstractAuth; 15 | 16 | /** 17 | * This is the edit auth middleware class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class Edit extends AbstractAuth 22 | { 23 | // clever stuff happens 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Http\Middleware; 13 | 14 | use Closure; 15 | use Illuminate\Contracts\Foundation\Application; 16 | use Illuminate\Contracts\View\Factory as View; 17 | use Illuminate\Http\Response; 18 | 19 | /** 20 | * This is the check for maintenance mode middleware class. 21 | * 22 | * @author Graham Campbell 23 | */ 24 | class CheckForMaintenanceMode 25 | { 26 | /** 27 | * The application instance. 28 | * 29 | * @var \Illuminate\Contracts\Foundation\Application 30 | */ 31 | protected $app; 32 | 33 | /** 34 | * The view factory instance. 35 | * 36 | * @var \Illuminate\Contracts\View\Factory 37 | */ 38 | protected $view; 39 | 40 | /** 41 | * Create a new check for maintenance mode instance. 42 | * 43 | * @param \Illuminate\Contracts\Foundation\Application $app 44 | * @param \Illuminate\Contracts\View\Factory $view 45 | * 46 | * @return void 47 | */ 48 | public function __construct(Application $app, View $view) 49 | { 50 | $this->app = $app; 51 | $this->view = $view; 52 | } 53 | 54 | /** 55 | * Handle an incoming request. 56 | * 57 | * @param \Illuminate\Http\Request $request 58 | * @param \Closure $next 59 | * 60 | * @return mixed 61 | */ 62 | public function handle($request, Closure $next) 63 | { 64 | if ($this->app->isDownForMaintenance()) { 65 | return new Response($this->view->make('maintenance')->render(), 503); 66 | } 67 | 68 | return $next($request); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/Http/Requests/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/app/Http/Requests/.gitkeep -------------------------------------------------------------------------------- /app/Http/filters.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use GrahamCampbell\Throttle\Facades\Throttle; 13 | use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; 14 | 15 | /* 16 | |-------------------------------------------------------------------------- 17 | | Throttling Filters 18 | |-------------------------------------------------------------------------- 19 | | 20 | | This is where we check the user is not spamming our system by limiting 21 | | certain types of actions with a throttler. 22 | | 23 | */ 24 | 25 | $router->filter('throttle.comment', function ($route, $request) { 26 | // check if we've reached the rate limit, but don't hit the throttle yet 27 | // we can hit the throttle later on in the if validation passes 28 | if (!Throttle::check($request, 10, 1)) { 29 | throw new TooManyRequestsHttpException(60, 'Rate limit exceeded.'); 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /app/Http/routes.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Application Routes 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Here is where you can register all of the routes for an application. 18 | | It's a breeze. Simply tell Laravel the URIs it should respond to 19 | | and give it the controller to call when that URI is requested. 20 | | 21 | */ 22 | 23 | // send users to the home page 24 | $router->get('/', ['as' => 'base', function () { 25 | Session::flash('', ''); // work around laravel bug if there is no session yet 26 | Session::reflash(); 27 | 28 | return Redirect::to('pages/home'); 29 | }]); 30 | 31 | // send users to the posts page 32 | if (Config::get('cms.blogging')) { 33 | $router->get('blog', ['as' => 'blog', function () { 34 | Session::flash('', ''); // work around laravel bug if there is no session yet 35 | Session::reflash(); 36 | 37 | return Redirect::route('blog.posts.index'); 38 | }]); 39 | } 40 | 41 | // page routes 42 | $router->resource('pages', 'PageController'); 43 | 44 | // blog routes 45 | if (Config::get('cms.blogging')) { 46 | $router->resource('blog/posts', 'PostController'); 47 | $router->resource('blog/posts.comments', 'CommentController'); 48 | } 49 | 50 | // event routes 51 | if (Config::get('cms.events')) { 52 | $router->resource('events', 'EventController'); 53 | } 54 | -------------------------------------------------------------------------------- /app/Models/Comment.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models; 13 | 14 | use GrahamCampbell\BootstrapCMS\Models\Relations\BelongsToPostTrait; 15 | use GrahamCampbell\Credentials\Models\AbstractModel; 16 | use GrahamCampbell\Credentials\Models\Relations\BelongsToUserTrait; 17 | use GrahamCampbell\Credentials\Models\Relations\RevisionableTrait; 18 | use Illuminate\Database\Eloquent\SoftDeletes; 19 | use McCool\LaravelAutoPresenter\HasPresenter; 20 | 21 | /** 22 | * This is the comment model class. 23 | * 24 | * @author Graham Campbell 25 | */ 26 | class Comment extends AbstractModel implements HasPresenter 27 | { 28 | use BelongsToPostTrait, BelongsToUserTrait, RevisionableTrait, SoftDeletes; 29 | 30 | /** 31 | * The table the comments are stored in. 32 | * 33 | * @var string 34 | */ 35 | protected $table = 'comments'; 36 | 37 | /** 38 | * The model name. 39 | * 40 | * @var string 41 | */ 42 | public static $name = 'comment'; 43 | 44 | /** 45 | * The properties on the model that are dates. 46 | * 47 | * @var array 48 | */ 49 | protected $dates = ['deleted_at']; 50 | 51 | /** 52 | * The revisionable columns. 53 | * 54 | * @var array 55 | */ 56 | protected $keepRevisionOf = ['body']; 57 | 58 | /** 59 | * The columns to select when displaying an index. 60 | * 61 | * @var array 62 | */ 63 | public static $index = ['id', 'body', 'user_id', 'created_at', 'version']; 64 | 65 | /** 66 | * The columns to order by when displaying an index. 67 | * 68 | * @var string 69 | */ 70 | public static $order = 'id'; 71 | 72 | /** 73 | * The direction to order by when displaying an index. 74 | * 75 | * @var string 76 | */ 77 | public static $sort = 'desc'; 78 | 79 | /** 80 | * The comment validation rules. 81 | * 82 | * @var array 83 | */ 84 | public static $rules = [ 85 | 'body' => 'required', 86 | 'user_id' => 'required', 87 | 'post_id' => 'required', 88 | ]; 89 | 90 | /** 91 | * Get the presenter class. 92 | * 93 | * @return string 94 | */ 95 | public function getPresenterClass() 96 | { 97 | return 'GrahamCampbell\BootstrapCMS\Presenters\CommentPresenter'; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /app/Models/Relations/BelongsToPostTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models\Relations; 13 | 14 | /** 15 | * This is the belongs to post trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait BelongsToPostTrait 20 | { 21 | /** 22 | * Get the post relation. 23 | * 24 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo 25 | */ 26 | public function post() 27 | { 28 | return $this->belongsTo('GrahamCampbell\BootstrapCMS\Models\Post'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Models/Relations/HasManyCommentsTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models\Relations; 13 | 14 | /** 15 | * This is the has many comments trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait HasManyCommentsTrait 20 | { 21 | /** 22 | * Get the comment relation. 23 | * 24 | * @return \Illuminate\Database\Eloquent\Relations\HasOneOrMany 25 | */ 26 | public function comments() 27 | { 28 | return $this->hasMany('GrahamCampbell\BootstrapCMS\Models\Comment'); 29 | } 30 | 31 | /** 32 | * Delete all comments. 33 | * 34 | * @return void 35 | */ 36 | public function deleteComments() 37 | { 38 | foreach ($this->comments()->get(['id']) as $comment) { 39 | $comment->delete(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Models/Relations/HasManyEventsTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models\Relations; 13 | 14 | /** 15 | * This is the has many events trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait HasManyEventsTrait 20 | { 21 | /** 22 | * Get the event relation. 23 | * 24 | * @return \Illuminate\Database\Eloquent\Relations\HasOneOrMany 25 | */ 26 | public function events() 27 | { 28 | return $this->hasMany('GrahamCampbell\BootstrapCMS\Models\Event'); 29 | } 30 | 31 | /** 32 | * Delete all events. 33 | * 34 | * @return void 35 | */ 36 | public function deleteEvents() 37 | { 38 | foreach ($this->events()->get(['id']) as $event) { 39 | $event->delete(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Models/Relations/HasManyPagesTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models\Relations; 13 | 14 | /** 15 | * This is the has many pages trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait HasManyPagesTrait 20 | { 21 | /** 22 | * Get the page relation. 23 | * 24 | * @return \Illuminate\Database\Eloquent\Relations\HasOneOrMany 25 | */ 26 | public function pages() 27 | { 28 | return $this->hasMany('GrahamCampbell\BootstrapCMS\Models\Page'); 29 | } 30 | 31 | /** 32 | * Delete all pages. 33 | * 34 | * @return void 35 | */ 36 | public function deletePages() 37 | { 38 | foreach ($this->pages()->get(['id', 'slug']) as $page) { 39 | $page->delete(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Models/Relations/HasManyPostsTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models\Relations; 13 | 14 | /** 15 | * This is the has many posts trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait HasManyPostsTrait 20 | { 21 | /** 22 | * Get the post relation. 23 | * 24 | * @return \Illuminate\Database\Eloquent\Relations\HasOneOrMany 25 | */ 26 | public function posts() 27 | { 28 | return $this->hasMany('GrahamCampbell\BootstrapCMS\Models\Post'); 29 | } 30 | 31 | /** 32 | * Delete all posts. 33 | * 34 | * @return void 35 | */ 36 | public function deletePosts() 37 | { 38 | foreach ($this->posts()->get(['id']) as $post) { 39 | $post->delete(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Models; 13 | 14 | use GrahamCampbell\BootstrapCMS\Models\Relations\HasManyCommentsTrait; 15 | use GrahamCampbell\BootstrapCMS\Models\Relations\HasManyEventsTrait; 16 | use GrahamCampbell\BootstrapCMS\Models\Relations\HasManyPagesTrait; 17 | use GrahamCampbell\BootstrapCMS\Models\Relations\HasManyPostsTrait; 18 | use GrahamCampbell\Credentials\Models\User as CredentialsUser; 19 | 20 | /** 21 | * This is the user model class. 22 | * 23 | * @author Graham Campbell 24 | */ 25 | class User extends CredentialsUser 26 | { 27 | use HasManyPagesTrait, HasManyPostsTrait, HasManyEventsTrait, HasManyCommentsTrait; 28 | 29 | /** 30 | * Get the presenter class. 31 | * 32 | * @return string 33 | */ 34 | public function getPresenterClass() 35 | { 36 | return 'GrahamCampbell\BootstrapCMS\Presenters\UserPresenter'; 37 | } 38 | 39 | /** 40 | * Before deleting an existing model. 41 | * 42 | * @return void 43 | */ 44 | public function beforeDelete() 45 | { 46 | $this->deletePages(); 47 | $this->deletePosts(); 48 | $this->deleteEvents(); 49 | $this->deleteComments(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Observers/PageObserver.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Observers; 13 | 14 | use GrahamCampbell\BootstrapCMS\Facades\PageRepository; 15 | 16 | /** 17 | * This is the page observer class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class PageObserver 22 | { 23 | /** 24 | * Handle a page creation. 25 | * 26 | * @return void 27 | */ 28 | public function created() 29 | { 30 | PageRepository::refresh(); 31 | } 32 | 33 | /** 34 | * Handle a page update. 35 | * 36 | * @return void 37 | */ 38 | public function updated() 39 | { 40 | PageRepository::refresh(); 41 | } 42 | 43 | /** 44 | * Handle a page deletion. 45 | * 46 | * @return void 47 | */ 48 | public function deleted() 49 | { 50 | PageRepository::refresh(); 51 | } 52 | 53 | /** 54 | * Handle a page save. 55 | * 56 | * @return void 57 | */ 58 | public function saved() 59 | { 60 | PageRepository::refresh(); 61 | } 62 | 63 | /** 64 | * Handle a page restore. 65 | * 66 | * @return void 67 | */ 68 | public function restored() 69 | { 70 | PageRepository::refresh(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Presenters/CommentPresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use GrahamCampbell\Credentials\Presenters\AuthorPresenterTrait; 15 | use McCool\LaravelAutoPresenter\BasePresenter; 16 | 17 | /** 18 | * This is the comment presenter class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class CommentPresenter extends BasePresenter 23 | { 24 | use AuthorPresenterTrait; 25 | } 26 | -------------------------------------------------------------------------------- /app/Presenters/ContentPresenterTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use GrahamCampbell\Markdown\Facades\Markdown; 15 | 16 | /** 17 | * This is the content presenter trait. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | trait ContentPresenterTrait 22 | { 23 | /** 24 | * Get the content. 25 | * 26 | * @return string 27 | */ 28 | public function content() 29 | { 30 | return Markdown::convertToHtml($this->getWrappedObject()->body); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Presenters/EventPresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use McCool\LaravelAutoPresenter\BasePresenter; 15 | 16 | /** 17 | * This is the event presenter class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class EventPresenter extends BasePresenter 22 | { 23 | use OwnerPresenterTrait, ContentPresenterTrait; 24 | } 25 | -------------------------------------------------------------------------------- /app/Presenters/OwnerPresenterTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | /** 15 | * This is the owner presenter trait. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | trait OwnerPresenterTrait 20 | { 21 | /** 22 | * Get the owner. 23 | * 24 | * @return string 25 | */ 26 | public function owner() 27 | { 28 | $user = $this->getWrappedObject()->user()->withTrashed()->first(['first_name', 'last_name', 'email']); 29 | 30 | return $user->first_name.' '.$user->last_name.' ('.$user->email.')'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Presenters/PagePresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use McCool\LaravelAutoPresenter\BasePresenter; 15 | 16 | /** 17 | * This is the page presenter class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class PagePresenter extends BasePresenter 22 | { 23 | use OwnerPresenterTrait; 24 | } 25 | -------------------------------------------------------------------------------- /app/Presenters/PostPresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use GrahamCampbell\Credentials\Presenters\AuthorPresenterTrait; 15 | use McCool\LaravelAutoPresenter\BasePresenter; 16 | 17 | /** 18 | * This is the post presenter class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class PostPresenter extends BasePresenter 23 | { 24 | use AuthorPresenterTrait, OwnerPresenterTrait, ContentPresenterTrait; 25 | } 26 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/AbstractRevisionDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers; 13 | 14 | use GrahamCampbell\Credentials\Presenters\RevisionDisplayers\AbstractRevisionDisplayer as BaseRevisionDisplayer; 15 | use GrahamCampbell\Credentials\Presenters\RevisionDisplayers\RevisionDisplayerInterface; 16 | 17 | /** 18 | * This is the abstract displayer class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | abstract class AbstractRevisionDisplayer extends BaseRevisionDisplayer implements RevisionDisplayerInterface 23 | { 24 | /** 25 | * Get the change description. 26 | * 27 | * @return string 28 | */ 29 | public function description() 30 | { 31 | if ($this->presenter->wasByCurrentUser()) { 32 | return $this->current(); 33 | } 34 | 35 | return $this->external(); 36 | } 37 | 38 | /** 39 | * Get the change description from the context of 40 | * the change being made by the current user. 41 | * 42 | * @return string 43 | */ 44 | abstract protected function current(); 45 | 46 | /** 47 | * Get the change description from the context of 48 | * the change not being made by the current user. 49 | * 50 | * @return string 51 | */ 52 | abstract protected function external(); 53 | } 54 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Comment/AbstractDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Comment; 13 | 14 | use GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\AbstractRevisionDisplayer; 15 | 16 | /** 17 | * This is the abstract displayer class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | abstract class AbstractDisplayer extends AbstractRevisionDisplayer 22 | { 23 | /** 24 | * Get the post name. 25 | * 26 | * @return string 27 | */ 28 | protected function name() 29 | { 30 | $comment = $this->wrappedObject->revisionable()->withTrashed()->first(['post_id']); 31 | 32 | $post = $comment->post()->withTrashed()->first(['title']); 33 | 34 | return ' "'.$post->title.'".'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Comment/BodyDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Comment; 13 | 14 | /** 15 | * This is the body displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class BodyDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Edited Comment'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You edited a comment on'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user edited a comment on'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Comment/CreatedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Comment; 13 | 14 | /** 15 | * This is the created at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class CreatedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Created Comment'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You commented on'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user commented on'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Comment/DeletedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Comment; 13 | 14 | /** 15 | * This is the deleted at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class DeletedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Deleted Comment'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You deleted a comment on'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user deleted a comment on'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/AbstractDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | use GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\AbstractRevisionDisplayer; 15 | 16 | /** 17 | * This is the abstract displayer class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | abstract class AbstractDisplayer extends AbstractRevisionDisplayer 22 | { 23 | /** 24 | * Get the change title. 25 | * 26 | * @return string 27 | */ 28 | public function title() 29 | { 30 | return 'Updated Event'; 31 | } 32 | 33 | /** 34 | * Get the event name. 35 | * 36 | * @return string 37 | */ 38 | protected function name() 39 | { 40 | $event = $this->wrappedObject->revisionable()->withTrashed()->first(['title']); 41 | 42 | return ' "'.$event->title.'".'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/BodyDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the body displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class BodyDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the description of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the description of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/CreatedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the created at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class CreatedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Created Event'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You created a new event called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user created a new event called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/DateDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the date displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class DateDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the date of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the date of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/DeletedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the deleted at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class DeletedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Deleted Event'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You deleted the event called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user deleted the event called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/LocationDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the location displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class LocationDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the location of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the location of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Event/TitleDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Event; 13 | 14 | /** 15 | * This is the title displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class TitleDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the title of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the title of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/AbstractDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | use GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\AbstractRevisionDisplayer; 15 | 16 | /** 17 | * This is the abstract displayer class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | abstract class AbstractDisplayer extends AbstractRevisionDisplayer 22 | { 23 | /** 24 | * Get the change title. 25 | * 26 | * @return string 27 | */ 28 | public function title() 29 | { 30 | return 'Updated Page'; 31 | } 32 | 33 | /** 34 | * Get the page name. 35 | * 36 | * @param bool $final 37 | * 38 | * @return string 39 | */ 40 | protected function name($final = true) 41 | { 42 | $page = $this->wrappedObject->revisionable()->withTrashed()->first(['title']); 43 | 44 | if ($final) { 45 | return ' "'.$page->title.'".'; 46 | } 47 | 48 | return ' "'.$page->title.'" '; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/BodyDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the body displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class BodyDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the content of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the content of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/CreatedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the created at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class CreatedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Created Page'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You created a new page called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user created a new page called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/CssDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the css displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class CssDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the css of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the css of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/DeletedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the deleted at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class DeletedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Deleted Page'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You deleted the page called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user deleted the page called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/IconDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the icon displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class IconDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the icon of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the icon of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/JsDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the js displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class JsDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the js of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the js of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/NavTitleDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the nav title displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class NavTitleDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the nav title of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the nav title of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/ShowNavDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the show nav displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class ShowNavDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | if ($this->wrappedObject->new_value) { 30 | return 'You added '.$this->name(false).'to the nav bar.'; 31 | } 32 | 33 | return 'You removed '.$this->name(false).'from the nav bar.'; 34 | } 35 | 36 | /** 37 | * Get the change description from the context of 38 | * the change not being made by the current user. 39 | * 40 | * @return string 41 | */ 42 | protected function external() 43 | { 44 | if ($this->wrappedObject->new_value) { 45 | return 'This user added '.$this->name(false).'to the nav bar.'; 46 | } 47 | 48 | return 'This user removed '.$this->name(false).'from the nav bar.'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/ShowTitleDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the show title displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class ShowTitleDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | if ($this->wrappedObject->new_value) { 30 | return 'You unhid the title of '.$this->name(); 31 | } 32 | 33 | return 'You hid the title of '.$this->name(); 34 | } 35 | 36 | /** 37 | * Get the change description from the context of 38 | * the change not being made by the current user. 39 | * 40 | * @return string 41 | */ 42 | protected function external() 43 | { 44 | if ($this->wrappedObject->new_value) { 45 | return 'This user unhid the title of '.$this->name(); 46 | } 47 | 48 | return 'This user hid the title of '.$this->name(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/SlugDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the slug displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class SlugDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the slug of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the slug of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Page/TitleDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Page; 13 | 14 | /** 15 | * This is the title displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class TitleDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the title of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the title of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/AbstractDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | use GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\AbstractRevisionDisplayer; 15 | 16 | /** 17 | * This is the abstract displayer class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | abstract class AbstractDisplayer extends AbstractRevisionDisplayer 22 | { 23 | /** 24 | * Get the change title. 25 | * 26 | * @return string 27 | */ 28 | public function title() 29 | { 30 | return 'Updated Post'; 31 | } 32 | 33 | /** 34 | * Get the post name. 35 | * 36 | * @return string 37 | */ 38 | protected function name() 39 | { 40 | $post = $this->wrappedObject->revisionable()->withTrashed()->first(['title']); 41 | 42 | return ' "'.$post->title.'".'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/BodyDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | /** 15 | * This is the body displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class BodyDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the content of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the content of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/CreatedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | /** 15 | * This is the created at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class CreatedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Created Post'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You created a new post called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user created a new post called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/DeletedAtDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | /** 15 | * This is the deleted at displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class DeletedAtDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change title. 23 | * 24 | * @return string 25 | */ 26 | public function title() 27 | { 28 | return 'Deleted Post'; 29 | } 30 | 31 | /** 32 | * Get the change description from the context of 33 | * the change being made by the current user. 34 | * 35 | * @return string 36 | */ 37 | protected function current() 38 | { 39 | return 'You deleted the post called'.$this->name(); 40 | } 41 | 42 | /** 43 | * Get the change description from the context of 44 | * the change not being made by the current user. 45 | * 46 | * @return string 47 | */ 48 | protected function external() 49 | { 50 | return 'This user deleted the post called'.$this->name(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/SummaryDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | /** 15 | * This is the summary displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class SummaryDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the summary of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the summary of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/RevisionDisplayers/Post/TitleDisplayer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters\RevisionDisplayers\Post; 13 | 14 | /** 15 | * This is the title displayer class. 16 | * 17 | * @author Graham Campbell 18 | */ 19 | class TitleDisplayer extends AbstractDisplayer 20 | { 21 | /** 22 | * Get the change description from the context of 23 | * the change being made by the current user. 24 | * 25 | * @return string 26 | */ 27 | protected function current() 28 | { 29 | return 'You updated the title of'.$this->name(); 30 | } 31 | 32 | /** 33 | * Get the change description from the context of 34 | * the change not being made by the current user. 35 | * 36 | * @return string 37 | */ 38 | protected function external() 39 | { 40 | return 'This user updated the title of'.$this->name(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Presenters/UserPresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Presenters; 13 | 14 | use GrahamCampbell\Credentials\Presenters\UserPresenter as BasePresenter; 15 | 16 | /** 17 | * This is the author presenter trait. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class UserPresenter extends BasePresenter 22 | { 23 | // 24 | } 25 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Providers; 13 | 14 | use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; 15 | use Illuminate\Routing\Router; 16 | 17 | /** 18 | * This is the route service provider class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class RouteServiceProvider extends ServiceProvider 23 | { 24 | /** 25 | * This namespace is applied to the controller routes in your routes file. 26 | * 27 | * In addition, it is set as the URL generator's root namespace. 28 | * 29 | * @var string 30 | */ 31 | protected $namespace = 'GrahamCampbell\BootstrapCMS\Http\Controllers'; 32 | 33 | /** 34 | * Define the route model bindings, pattern filters, etc. 35 | * 36 | * @param \Illuminate\Routing\Router $router 37 | * 38 | * @return void 39 | */ 40 | public function boot(Router $router) 41 | { 42 | parent::boot($router); 43 | 44 | require app_path('Http/filters.php'); 45 | } 46 | 47 | /** 48 | * Define the routes for the application. 49 | * 50 | * @param \Illuminate\Routing\Router $router 51 | * 52 | * @return void 53 | */ 54 | public function map(Router $router) 55 | { 56 | $router->group(['namespace' => $this->namespace], function ($router) { 57 | require app_path('Http/routes.php'); 58 | }); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/Repositories/CommentRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Repositories; 13 | 14 | use GrahamCampbell\Credentials\Repositories\AbstractRepository; 15 | 16 | /** 17 | * This is the comment repository class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CommentRepository extends AbstractRepository 22 | { 23 | // 24 | } 25 | -------------------------------------------------------------------------------- /app/Repositories/EventRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Repositories; 13 | 14 | use GrahamCampbell\Credentials\Repositories\AbstractRepository; 15 | use GrahamCampbell\Credentials\Repositories\PaginateRepositoryTrait; 16 | 17 | /** 18 | * This is the event repository class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class EventRepository extends AbstractRepository 23 | { 24 | use PaginateRepositoryTrait; 25 | } 26 | -------------------------------------------------------------------------------- /app/Repositories/PostRepository.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Repositories; 13 | 14 | use GrahamCampbell\Credentials\Repositories\AbstractRepository; 15 | use GrahamCampbell\Credentials\Repositories\PaginateRepositoryTrait; 16 | 17 | /** 18 | * This is the post repository class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class PostRepository extends AbstractRepository 23 | { 24 | use PaginateRepositoryTrait; 25 | } 26 | -------------------------------------------------------------------------------- /app/Seeds/CommentsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use Carbon\Carbon; 15 | use Illuminate\Database\Seeder; 16 | use Illuminate\Support\Facades\DB; 17 | 18 | /** 19 | * This is the comments table seeder class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class CommentsTableSeeder extends Seeder 24 | { 25 | /** 26 | * Run the database seeding. 27 | * 28 | * @return void 29 | */ 30 | public function run() 31 | { 32 | DB::table('comments')->truncate(); 33 | 34 | $comment = [ 35 | 'body' => 'This is an example comment.', 36 | 'user_id' => 1, 37 | 'post_id' => 1, 38 | 'created_at' => Carbon::now(), 39 | 'updated_at' => Carbon::now(), 40 | ]; 41 | 42 | DB::table('comments')->insert($comment); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Seeds/EventsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use Carbon\Carbon; 15 | use Illuminate\Database\Seeder; 16 | use Illuminate\Support\Facades\DB; 17 | 18 | /** 19 | * This is the events table seeder class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class EventsTableSeeder extends Seeder 24 | { 25 | /** 26 | * Run the database seeding. 27 | * 28 | * @return void 29 | */ 30 | public function run() 31 | { 32 | DB::table('events')->truncate(); 33 | 34 | $date = Carbon::now()->addWeeks(2); 35 | 36 | $date->second = 0; 37 | 38 | $event = [ 39 | 'title' => 'Example Event', 40 | 'date' => $date, 41 | 'location' => 'Example Location', 42 | 'body' => 'This is an example event.', 43 | 'user_id' => 1, 44 | 'created_at' => Carbon::now(), 45 | 'updated_at' => Carbon::now(), 46 | ]; 47 | 48 | DB::table('events')->insert($event); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Seeds/GroupsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use GrahamCampbell\Credentials\Facades\Credentials; 15 | use Illuminate\Database\Seeder; 16 | use Illuminate\Support\Facades\DB; 17 | 18 | /** 19 | * This is the groups table seeder class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class GroupsTableSeeder extends Seeder 24 | { 25 | /** 26 | * Run the database seeding. 27 | * 28 | * @return void 29 | */ 30 | public function run() 31 | { 32 | DB::table('groups')->truncate(); 33 | 34 | // users 35 | $permissions = ['user' => 1, 'edit' => 0, 'blog' => 0, 'mod' => 0, 'admin' => 0]; 36 | $group = ['name' => 'Users', 'permissions' => $permissions]; 37 | Credentials::getGroupProvider()->create($group); 38 | 39 | // editors 40 | $permissions = ['user' => 1, 'edit' => 1, 'blog' => 0, 'mod' => 0, 'admin' => 0]; 41 | $group = ['name' => 'Editors', 'permissions' => $permissions]; 42 | Credentials::getGroupProvider()->create($group); 43 | 44 | // bloggers 45 | $permissions = ['user' => 1, 'edit' => 0, 'blog' => 1, 'mod' => 0, 'admin' => 0]; 46 | $group = ['name' => 'Bloggers', 'permissions' => $permissions]; 47 | Credentials::getGroupProvider()->create($group); 48 | 49 | // moderators 50 | $permissions = ['user' => 1, 'edit' => 0, 'blog' => 0, 'mod' => 1, 'admin' => 0]; 51 | $group = ['name' => 'Moderators', 'permissions' => $permissions]; 52 | Credentials::getGroupProvider()->create($group); 53 | 54 | // admins 55 | $permissions = ['user' => 1, 'edit' => 1, 'blog' => 1, 'mod' => 1, 'admin' => 1]; 56 | $group = ['name' => 'Admins', 'permissions' => $permissions]; 57 | Credentials::getGroupProvider()->create($group); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Seeds/PagesTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use Carbon\Carbon; 15 | use GrahamCampbell\Binput\Facades\Binput; 16 | use Illuminate\Database\Seeder; 17 | use Illuminate\Support\Facades\DB; 18 | use Illuminate\Support\Facades\File; 19 | 20 | /** 21 | * This is the pages table seeder class. 22 | * 23 | * @author Graham Campbell 24 | */ 25 | class PagesTableSeeder extends Seeder 26 | { 27 | /** 28 | * Run the database seeding. 29 | * 30 | * @return void 31 | */ 32 | public function run() 33 | { 34 | DB::table('pages')->truncate(); 35 | 36 | $home = [ 37 | 'title' => 'Welcome', 38 | 'nav_title' => 'Home', 39 | 'slug' => 'home', 40 | 'body' => $this->getContent('home'), 41 | 'show_title' => false, 42 | 'icon' => 'home', 43 | 'user_id' => 1, 44 | 'created_at' => Carbon::now(), 45 | 'updated_at' => Carbon::now(), 46 | ]; 47 | 48 | DB::table('pages')->insert($home); 49 | 50 | $contact = [ 51 | 'title' => 'Contact Us', 52 | 'nav_title' => 'Contact', 53 | 'slug' => 'contact', 54 | 'body' => $this->getContent('contact'), 55 | 'user_id' => 1, 56 | 'icon' => 'envelope', 57 | 'created_at' => Carbon::now(), 58 | 'updated_at' => Carbon::now(), 59 | ]; 60 | 61 | DB::table('pages')->insert($contact); 62 | 63 | $about = [ 64 | 'title' => 'About Us', 65 | 'nav_title' => 'About', 66 | 'slug' => 'about', 67 | 'body' => $this->getContent('about'), 68 | 'user_id' => 1, 69 | 'icon' => 'info-circle', 70 | 'created_at' => Carbon::now(), 71 | 'updated_at' => Carbon::now(), 72 | ]; 73 | 74 | DB::table('pages')->insert($about); 75 | } 76 | 77 | /** 78 | * Get the page content. 79 | * 80 | * @param string $page 81 | * 82 | * @return string 83 | */ 84 | protected function getContent($page) 85 | { 86 | $content = File::get(dirname(__FILE__).'/page-'.$page.'.stub'); 87 | 88 | return Binput::clean($content, true, false); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/Seeds/PostsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use Carbon\Carbon; 15 | use Illuminate\Database\Seeder; 16 | use Illuminate\Support\Facades\DB; 17 | 18 | /** 19 | * This is the posts table seeder class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class PostsTableSeeder extends Seeder 24 | { 25 | /** 26 | * Run the database seeding. 27 | * 28 | * @return void 29 | */ 30 | public function run() 31 | { 32 | DB::table('posts')->truncate(); 33 | 34 | $post = [ 35 | 'title' => 'Hello World', 36 | 'summary' => 'This is the first blog post.', 37 | 'body' => 'This is an example blog post.', 38 | 'user_id' => 1, 39 | 'created_at' => Carbon::now(), 40 | 'updated_at' => Carbon::now(), 41 | ]; 42 | 43 | DB::table('posts')->insert($post); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Seeds/UsersGroupsTableSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Seeds; 13 | 14 | use GrahamCampbell\Credentials\Facades\Credentials; 15 | use Illuminate\Database\Seeder; 16 | use Illuminate\Support\Facades\DB; 17 | 18 | /** 19 | * This is the users/groups table seeder class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class UsersGroupsTableSeeder extends Seeder 24 | { 25 | /** 26 | * Run the database seeding. 27 | * 28 | * @return void 29 | */ 30 | public function run() 31 | { 32 | DB::table('users_groups')->truncate(); 33 | 34 | $this->matchUser('admin@dsmg.co.uk', 'Admins'); 35 | $this->matchUser('semiadmin@dsmg.co.uk', 'Moderators'); 36 | $this->matchUser('semiadmin@dsmg.co.uk', 'Bloggers'); 37 | $this->matchUser('semiadmin@dsmg.co.uk', 'Editors'); 38 | $this->matchUser('moderator@dsmg.co.uk', 'Moderators'); 39 | $this->matchUser('blogger@dsmg.co.uk', 'Bloggers'); 40 | $this->matchUser('editor@dsmg.co.uk', 'Editors'); 41 | $this->matchUser('user@dsmg.co.uk', 'Users'); 42 | } 43 | 44 | /** 45 | * Add the user by email to a group. 46 | * 47 | * @param string $email 48 | * @param string $group 49 | * 50 | * @return void 51 | */ 52 | protected function matchUser($email, $group) 53 | { 54 | return Credentials::getUserProvider()->findByLogin($email) 55 | ->addGroup(Credentials::getGroupProvider()->findByName($group)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Seeds/page-about.stub: -------------------------------------------------------------------------------- 1 |

This is the about page!

2 | -------------------------------------------------------------------------------- /app/Seeds/page-contact.stub: -------------------------------------------------------------------------------- 1 |

You may contact us here.

2 |
3 | -------------------------------------------------------------------------------- /app/Subscribers/CommandSubscriber.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\BootstrapCMS\Subscribers; 13 | 14 | use GrahamCampbell\BootstrapCMS\Repositories\PageRepository; 15 | use Illuminate\Console\Command; 16 | use Illuminate\Events\Dispatcher; 17 | 18 | /** 19 | * This is the command subscriber class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class CommandSubscriber 24 | { 25 | /** 26 | * The page repository instance. 27 | * 28 | * @var \GrahamCampbell\BootstrapCMS\Repositories\PageRepository 29 | */ 30 | protected $pagerepository; 31 | 32 | /** 33 | * Create a new instance. 34 | * 35 | * @param \GrahamCampbell\BootstrapCMS\Repositories\PageRepository $pagerepository 36 | * 37 | * @return void 38 | */ 39 | public function __construct(PageRepository $pagerepository) 40 | { 41 | $this->pagerepository = $pagerepository; 42 | } 43 | 44 | /** 45 | * Register the listeners for the subscriber. 46 | * 47 | * @param \Illuminate\Events\Dispatcher $events 48 | * 49 | * @return void 50 | */ 51 | public function subscribe(Dispatcher $events) 52 | { 53 | $events->listen( 54 | 'command.updatecache', 55 | 'GrahamCampbell\BootstrapCMS\Subscribers\CommandSubscriber@onUpdateCache', 56 | 3 57 | ); 58 | } 59 | 60 | /** 61 | * Handle a command.updatecache event. 62 | * 63 | * @param \Illuminate\Console\Command $command 64 | * 65 | * @return void 66 | */ 67 | public function onUpdateCache(Command $command) 68 | { 69 | $command->line('Regenerating page cache...'); 70 | $this->pagerepository->refresh(); 71 | $command->info('Page cache regenerated!'); 72 | } 73 | 74 | /** 75 | * Get the page repository instance. 76 | * 77 | * @return \GrahamCampbell\BootstrapCMS\Repositories\PageRepository 78 | */ 79 | public function getPageRepository() 80 | { 81 | return $this->pagerepository; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | /* 14 | |-------------------------------------------------------------------------- 15 | | Register The Auto Loader 16 | |-------------------------------------------------------------------------- 17 | | 18 | | Composer provides a convenient, automatically generated class loader 19 | | for our application. We just need to utilize it! We'll require it 20 | | into the script here so that we do not have to worry about the 21 | | loading of any our classes "manually". Feels great to relax. 22 | | 23 | */ 24 | 25 | require __DIR__.'/bootstrap/autoload.php'; 26 | 27 | $app = require_once __DIR__.'/bootstrap/app.php'; 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Run The Artisan Application 32 | |-------------------------------------------------------------------------- 33 | | 34 | | When we run the console application, the current CLI command will be 35 | | executed in this console and the response sent back to a terminal 36 | | or another output device for the developers. Here goes nothing! 37 | | 38 | */ 39 | 40 | $kernel = $app->make('Illuminate\Contracts\Console\Kernel'); 41 | 42 | $status = $kernel->handle( 43 | $input = new Symfony\Component\Console\Input\ArgvInput(), 44 | new Symfony\Component\Console\Output\ConsoleOutput() 45 | ); 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Shutdown The Application 50 | |-------------------------------------------------------------------------- 51 | | 52 | | Once Artisan has finished running. We will fire off the shutdown events 53 | | so that any final work may be done by the application before we shut 54 | | down the process. This is the last thing to happen to the request. 55 | | 56 | */ 57 | 58 | $kernel->terminate($input, $status); 59 | 60 | exit($status); 61 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Create The Application 15 | |-------------------------------------------------------------------------- 16 | | 17 | | The first thing we will do is create a new Laravel application instance 18 | | which serves as the "glue" for all the components of Laravel, and is 19 | | the IoC container for the system binding all of the various parts. 20 | | 21 | */ 22 | 23 | $app = new Illuminate\Foundation\Application(realpath(__DIR__.'/../')); 24 | 25 | /* 26 | |-------------------------------------------------------------------------- 27 | | Bind Important Interfaces 28 | |-------------------------------------------------------------------------- 29 | | 30 | | Next, we need to bind some important interfaces into the container so 31 | | we will be able to resolve them when needed. The kernels serve the 32 | | incoming requests to this application from both the web and CLI. 33 | | 34 | */ 35 | 36 | $app->singleton('Illuminate\Contracts\Http\Kernel', 'GrahamCampbell\BootstrapCMS\Http\Kernel'); 37 | 38 | $app->singleton('Illuminate\Contracts\Console\Kernel', 'GrahamCampbell\BootstrapCMS\Console\Kernel'); 39 | 40 | $app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'GrahamCampbell\Exceptions\ExceptionHandler'); 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Return The Application 45 | |-------------------------------------------------------------------------- 46 | | 47 | | This script returns the application instance. The instance is given to 48 | | the calling script so we can separate the building of the instances 49 | | from the actual running of the application and sending responses. 50 | | 51 | */ 52 | 53 | return $app; 54 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | define('LARAVEL_START', microtime(true)); 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Register The Composer Auto Loader 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Composer provides a convenient, automatically generated class loader 20 | | for our application. We just need to utilize it! We'll require it 21 | | into the script here so that we do not have to worry about the 22 | | loading of any our classes "manually". Feels great to relax. 23 | | 24 | */ 25 | 26 | require __DIR__.'/../vendor/autoload.php'; 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Include The Compiled Class File 31 | |-------------------------------------------------------------------------- 32 | | 33 | | To dramatically increase your application's performance, you may use a 34 | | compiled class file which contains all of the classes commonly used 35 | | by a request. The Artisan "optimize" is used to create this file. 36 | | 37 | */ 38 | 39 | if (file_exists($compiledPath = __DIR__.'/cache/compiled.php')) { 40 | require $compiledPath; 41 | } 42 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /config/analytics.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Enable Google Analytics 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines if Google Analytics is enabled. 20 | | 21 | | Requires a valid Google Analytics Tracking ID. 22 | | 23 | | Default to false. 24 | | 25 | */ 26 | 27 | 'google' => false, 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Google Analytics Tracking ID 32 | |-------------------------------------------------------------------------- 33 | | 34 | | This defines the Google Analytics Tracking ID to use. 35 | | 36 | | Default to 'UA-XXXXXXXX-X'. 37 | | 38 | */ 39 | 40 | 'googleid' => 'UA-XXXXXXXX-X', 41 | 42 | ]; 43 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Default Broadcaster 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option controls the default broadcaster that will be used by the 20 | | framework when an event needs to be broadcast. You may set this to 21 | | any of the connections defined in the "connections" array below. 22 | | 23 | */ 24 | 25 | 'default' => env('BROADCAST_DRIVER', 'pusher'), 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Broadcast Connections 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Here you may define all of the broadcast connections that will be used 33 | | to broadcast events to other systems or over websockets. Samples of 34 | | each available type of connection are provided inside this array. 35 | | 36 | */ 37 | 38 | 'connections' => [ 39 | 40 | 'pusher' => [ 41 | 'driver' => 'pusher', 42 | 'key' => env('PUSHER_KEY'), 43 | 'secret' => env('PUSHER_SECRET'), 44 | 'app_id' => env('PUSHER_APP_ID'), 45 | ], 46 | 47 | 'redis' => [ 48 | 'driver' => 'redis', 49 | 'connection' => 'default', 50 | ], 51 | 52 | 'log' => [ 53 | 'driver' => 'log', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Default Cache Store 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option controls the default cache connection that gets used while 20 | | using this caching library. This connection is used when another is 21 | | not explicitly specified when executing a given caching function. 22 | | 23 | */ 24 | 25 | 'default' => env('CACHE_DRIVER', 'file'), 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Cache Stores 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Here you may define all of the cache "stores" for your application as 33 | | well as their drivers. You may even define multiple stores for the 34 | | same cache driver to group types of items stored in your caches. 35 | | 36 | */ 37 | 38 | 'stores' => [ 39 | 40 | 'apc' => [ 41 | 'driver' => 'apc', 42 | ], 43 | 44 | 'array' => [ 45 | 'driver' => 'array', 46 | ], 47 | 48 | 'database' => [ 49 | 'driver' => 'database', 50 | 'table' => 'cache', 51 | 'connection' => null, 52 | ], 53 | 54 | 'file' => [ 55 | 'driver' => 'file', 56 | 'path' => storage_path('framework/cache'), 57 | ], 58 | 59 | 'memcached' => [ 60 | 'driver' => 'memcached', 61 | 'servers' => [ 62 | [ 63 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100, 64 | ], 65 | ], 66 | ], 67 | 68 | 'redis' => [ 69 | 'driver' => 'redis', 70 | 'connection' => 'default', 71 | ], 72 | 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Cache Key Prefix 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When utilizing a RAM based store such as APC or Memcached, there might 81 | | be other applications utilizing the same cache. So, we'll specify a 82 | | value to get prefixed to all our keys so we can avoid collisions. 83 | | 84 | */ 85 | 86 | 'prefix' => 'laravel', 87 | 88 | ]; 89 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Additional Compiled Classes 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Here you may specify additional classes to include in the compiled file 20 | | generated by the `artisan optimize` command. These should be classes 21 | | that are included on basically every request into the application. 22 | | 23 | */ 24 | 25 | 'files' => [], 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Compiled File Providers 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Here you may list service providers which define a "compiles" function 33 | | that returns additional files that should be compiled, providing an 34 | | easy way to get common files from any packages you are utilizing. 35 | | 36 | */ 37 | 38 | 'providers' => [], 39 | 40 | ]; 41 | -------------------------------------------------------------------------------- /config/contact.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Path To The Form 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines the path to the contact form. This is the page where your 20 | | contact form should be. 21 | | 22 | | Default to 'pages/contact'. 23 | | 24 | */ 25 | 26 | 'path' => 'pages/contact', 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Contact Form Email 31 | |-------------------------------------------------------------------------- 32 | | 33 | | This defines the email address to send contact form messages to. It can 34 | | be a single address, or an array of email addresses. 35 | | 36 | | Default to 'admin@example.com'. 37 | | 38 | */ 39 | 40 | 'email' => env('CONTACT_EMAIL', 'admin@example.com'), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Email Layout 45 | |-------------------------------------------------------------------------- 46 | | 47 | | This defines the layout to extend when building email views. 48 | | 49 | | Default to 'layouts.email'. 50 | | 51 | */ 52 | 53 | 'layout' => 'layouts.email', 54 | 55 | ]; 56 | -------------------------------------------------------------------------------- /config/credentials.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Enable Public Registration 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines if public registration is allowed. 20 | | 21 | | Default to true. 22 | | 23 | */ 24 | 25 | 'regallowed' => env('CRED_REG', true), 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Require Account Activation 30 | |-------------------------------------------------------------------------- 31 | | 32 | | This defines if public registration requires email activation. 33 | | 34 | | Default to true. 35 | | 36 | */ 37 | 38 | 'activation' => env('CRED_ACTIVATION', true), 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Revision Model 43 | |-------------------------------------------------------------------------- 44 | | 45 | | This defines the revision model to be used. 46 | | 47 | | Default: 'GrahamCampbell\Credentials\Models\Revision' 48 | | 49 | */ 50 | 51 | 'revision' => 'GrahamCampbell\Credentials\Models\Revision', 52 | 53 | /* 54 | |-------------------------------------------------------------------------- 55 | | Home 56 | |-------------------------------------------------------------------------- 57 | | 58 | | This defines the location of the homepage. 59 | | 60 | | Default to '/'. 61 | | 62 | */ 63 | 64 | 'home' => 'pages/home', 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Layout 69 | |-------------------------------------------------------------------------- 70 | | 71 | | This defines the layout to extend when building views. 72 | | 73 | | Default to 'layouts.default'. 74 | | 75 | */ 76 | 77 | 'layout' => 'layouts.default', 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Email Layout 82 | |-------------------------------------------------------------------------- 83 | | 84 | | This defines the layout to extend when building email views. 85 | | 86 | | Default to 'layouts.email'. 87 | | 88 | */ 89 | 90 | 'email' => 'layouts.email', 91 | 92 | ]; 93 | -------------------------------------------------------------------------------- /config/date.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | PHP Format 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Take a look at http://php.net/manual/en/function.date.php. 20 | | 21 | | NOTE: this must be compatible with the javascript date. 22 | | 23 | */ 24 | 25 | 'php_format' => 'd/m/Y H:i', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Javascript Format 30 | |-------------------------------------------------------------------------- 31 | | 32 | | This is the format that the javascript datepicker needs. 33 | | 34 | | NOTE: this must be compatible with the php date. 35 | | 36 | | D: Day without leading 0 37 | | DD: Day with leading 0 38 | | M: Month without leading 0 39 | | MM: Month with leading 0 40 | | YY: Year - 2 digits 41 | | YYYY: Year - 4 digits 42 | | 43 | | HH: 24 hour with leading 0 44 | | hh: 12 hour with leading 0 45 | | H: 24 hour without leading 0 46 | | h: 12 hour without leading 0 47 | | mm: minute with leading 0 48 | | m: minute with leading 0 49 | | A: AM/PM 50 | | a: am/pm 51 | | 52 | */ 53 | 54 | 'js_format' => 'D/M/YYYY HH:mm', 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | PHP Display Format 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Take a look at http://php.net/manual/en/function.date.php. 62 | | 63 | */ 64 | 65 | 'php_display_format' => 'l jS F Y H:i', 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/htmlmin.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Automatic Blade Optimizations 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option enables minification of the blade views as they are 20 | | compiled. These optimizations have little impact on php processing time 21 | | as the optimizations are only applied once and are cached. This package 22 | | will do nothing by default to allow it to be used without minifying 23 | | pages automatically. 24 | | 25 | | Default: false 26 | | 27 | */ 28 | 29 | 'blade' => false, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Force Blade Optimizations 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This option forces blade minification on views where there such 37 | | minification may be dangerous. This should only be used if you are fully 38 | | aware of the potential issues this may cause. Obviously, this setting is 39 | | dependent on blade minification actually being enabled. 40 | | 41 | | PLEASE USE WITH CAUTION 42 | | 43 | | Default: false 44 | | 45 | */ 46 | 47 | 'force' => false, 48 | 49 | ]; 50 | -------------------------------------------------------------------------------- /config/logviewer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Middleware 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines the middleware to be put in front of the endpoints provided 20 | | by this package. A common use will be for your own authentication 21 | | middleware. 22 | | 23 | | Default to []. 24 | | 25 | */ 26 | 27 | 'middleware' => ['GrahamCampbell\Credentials\Http\Middleware\Auth\Admin'], 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Per Page 32 | |-------------------------------------------------------------------------- 33 | | 34 | | This defines how many log entries are displayed per page. 35 | | 36 | | Default to 20. 37 | | 38 | */ 39 | 40 | 'per_page' => 20, 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Layout 45 | |-------------------------------------------------------------------------- 46 | | 47 | | This defines the layout to extend when building views. 48 | | 49 | | Default to 'layouts.default'. 50 | | 51 | */ 52 | 53 | 'layout' => 'layouts.default', 54 | 55 | ]; 56 | -------------------------------------------------------------------------------- /config/markdown.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Enable View Integration 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option specifies if the view integration is enabled so you can write 20 | | markdown views and have them rendered as html. The following extensions 21 | | are currently supported: ".md", ".md.php", and ".md.blade.php". You may 22 | | disable this integration if it is conflicting with another package. 23 | | 24 | | Default: true 25 | | 26 | */ 27 | 28 | 'views' => true, 29 | 30 | ]; 31 | -------------------------------------------------------------------------------- /config/security.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Evil attributes 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines the evil attributes and they will be always be removed from 20 | | the input. 21 | | 22 | */ 23 | 'evil' => ['(? 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Third Party Services 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This file is for storing the credentials for third party services such 20 | | as Stripe, Mailgun, Mandrill, and others. This file provides a sane 21 | | default location for this type of information, allowing packages 22 | | to have a conventional place to find your various credentials. 23 | | 24 | */ 25 | 26 | 'mailgun' => [ 27 | 'domain' => env('MAILGUN_DOMAIN'), 28 | 'secret' => env('MAILGUN_SECRET'), 29 | ], 30 | 31 | 'mandrill' => [ 32 | 'secret' => env('MANDRILL_SECRET'), 33 | ], 34 | 35 | 'ses' => [ 36 | 'key' => env('SES_KEY'), 37 | 'secret' => env('SES_SECRET'), 38 | 'region' => 'us-east-1', 39 | ], 40 | 41 | 'stripe' => [ 42 | 'model' => 'GrahamCampbell\BootstrapCMS\Models\User', 43 | 'key' => env('STRIPE_KEY'), 44 | 'secret' => env('STRIPE_SECRET'), 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /config/theme.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | CSS Theme 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines what theme of Bootstrap to use from bootswatch.com. 20 | | 21 | | After making theme changes, you will have to run php artisan app:update. 22 | | 23 | | Supported: "cerulean", "cosmo", "cyborg", "darkly", "default", "flatly", 24 | | "journal", "legacy", "lumen", "paper", "readable", "sandstone", 25 | | "simplex", "slate", "spacelab", "superhero", "united", "yeti" 26 | | 27 | | Default to 'default'. 28 | | 29 | */ 30 | 31 | 'name' => env('THEME_NAME', 'default'), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Use Inverse Nav Bar 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This defines if the nav bar is inverse. 39 | | 40 | | When this is enabled, the "navbar-inverse" class will be used in the 41 | | navigation bar on all pages. 42 | | 43 | | Default to true. 44 | | 45 | */ 46 | 47 | 'inverse' => env('THEME_INVERSE', true), 48 | 49 | ]; 50 | -------------------------------------------------------------------------------- /config/throttle.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Cache Driver 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This defines the cache driver to be used. It may be the name of any 20 | | driver set in config/cache.php. Setting it to null will use the driver 21 | | you have set as default in config/cache.php. 22 | | 23 | | Default: null 24 | | 25 | */ 26 | 27 | 'driver' => null, 28 | 29 | ]; 30 | -------------------------------------------------------------------------------- /config/trustedproxy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Http\Request; 13 | 14 | return [ 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Trusted Proxies 19 | |-------------------------------------------------------------------------- 20 | | 21 | | Set trusted proxy IP addresses. Both IPv4 and IPv6 addresses are 22 | | supported, along with CIDR notation. The "*" character is syntactic sugar 23 | | within TrustedProxy to trust any proxy; a requirement when you cannot 24 | | know the address of your proxy (e.g. if using Rackspace balancers). 25 | | 26 | | By default, we are trusting CloudFlare only. 27 | | 28 | */ 29 | 30 | 'proxies' => [ 31 | '103.21.244.0/22', 32 | '103.22.200.0/22', 33 | '103.31.4.0/22', 34 | '104.16.0.0/12', 35 | '108.162.192.0/18', 36 | '141.101.64.0/18', 37 | '162.158.0.0/15', 38 | '172.64.0.0/13', 39 | '173.245.48.0/20', 40 | '188.114.96.0/20', 41 | '190.93.240.0/20', 42 | '197.234.240.0/22', 43 | '198.41.128.0/17', 44 | '199.27.128.0/21', 45 | '2400:cb00::/32', 46 | '2405:8100::/32', 47 | '2405:b500::/32', 48 | '2606:4700::/32', 49 | '2803:f800::/32', 50 | ], 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | Respected Headers 55 | |-------------------------------------------------------------------------- 56 | | 57 | | Change these if the proxy does not send the default header names. Note 58 | | that headers such as X-Forwarded-For are transformed to 59 | | HTTP_X_FORWARDED_FOR format. 60 | | 61 | | By default, we are using the Symfony defaults. 62 | | 63 | */ 64 | 65 | 'headers' => [ 66 | Request::HEADER_CLIENT_IP => 'X_FORWARDED_FOR', 67 | Request::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST', 68 | Request::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO', 69 | Request::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', 70 | ], 71 | 72 | ]; 73 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | View Storage Paths 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Most templating systems load templates from disk. Here you may specify 20 | | an array of paths that should be checked for your views. Of course 21 | | the usual Laravel view path has already been registered for you. 22 | | 23 | */ 24 | 25 | 'paths' => [ 26 | realpath(base_path('resources/views')), 27 | ], 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Compiled View Path 32 | |-------------------------------------------------------------------------- 33 | | 34 | | This option determines where all the compiled Blade templates will be 35 | | stored for your application. Typically, this is within the storage 36 | | directory. However, as usual, you are free to change this value. 37 | | 38 | */ 39 | 40 | 'compiled' => realpath(storage_path('framework/views')), 41 | 42 | ]; 43 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | class MigrationCartalystSentryInstallUsers extends Migration 17 | { 18 | /** 19 | * Run the migrations. 20 | * 21 | * @return void 22 | */ 23 | public function up() 24 | { 25 | Schema::create('users', function (Blueprint $table) { 26 | $table->increments('id'); 27 | $table->string('email'); 28 | $table->string('password'); 29 | $table->text('permissions')->nullable(); 30 | $table->boolean('activated')->default(0); 31 | $table->string('activation_code')->nullable(); 32 | $table->timestamp('activated_at')->nullable(); 33 | $table->timestamp('last_login')->nullable(); 34 | $table->string('persist_code')->nullable(); 35 | $table->string('reset_password_code')->nullable(); 36 | $table->string('first_name')->nullable(); 37 | $table->string('last_name')->nullable(); 38 | $table->timestamps(); 39 | 40 | // We'll need to ensure that MySQL uses the InnoDB engine to 41 | // support the indexes, other engines aren't affected. 42 | $table->engine = 'InnoDB'; 43 | $table->unique('email'); 44 | $table->index('activation_code'); 45 | $table->index('reset_password_code'); 46 | }); 47 | } 48 | 49 | /** 50 | * Reverse the migrations. 51 | * 52 | * @return void 53 | */ 54 | public function down() 55 | { 56 | Schema::drop('users'); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /database/migrations/2012_12_06_225929_migration_cartalyst_sentry_install_groups.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | class MigrationCartalystSentryInstallGroups extends Migration 17 | { 18 | /** 19 | * Run the migrations. 20 | * 21 | * @return void 22 | */ 23 | public function up() 24 | { 25 | Schema::create('groups', function (Blueprint $table) { 26 | $table->increments('id'); 27 | $table->string('name'); 28 | $table->text('permissions')->nullable(); 29 | $table->timestamps(); 30 | 31 | // We'll need to ensure that MySQL uses the InnoDB engine to 32 | // support the indexes, other engines aren't affected. 33 | $table->engine = 'InnoDB'; 34 | $table->unique('name'); 35 | }); 36 | } 37 | 38 | /** 39 | * Reverse the migrations. 40 | * 41 | * @return void 42 | */ 43 | public function down() 44 | { 45 | Schema::drop('groups'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | class MigrationCartalystSentryInstallUsersGroupsPivot extends Migration 17 | { 18 | /** 19 | * Run the migrations. 20 | * 21 | * @return void 22 | */ 23 | public function up() 24 | { 25 | Schema::create('users_groups', function (Blueprint $table) { 26 | $table->integer('user_id')->unsigned(); 27 | $table->integer('group_id')->unsigned(); 28 | 29 | // We'll need to ensure that MySQL uses the InnoDB engine to 30 | // support the indexes, other engines aren't affected. 31 | $table->engine = 'InnoDB'; 32 | $table->primary(['user_id', 'group_id']); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::drop('users_groups'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | class MigrationCartalystSentryInstallThrottle extends Migration 17 | { 18 | /** 19 | * Run the migrations. 20 | * 21 | * @return void 22 | */ 23 | public function up() 24 | { 25 | Schema::create('throttle', function (Blueprint $table) { 26 | $table->increments('id'); 27 | $table->integer('user_id')->unsigned()->nullable(); 28 | $table->string('ip_address')->nullable(); 29 | $table->integer('attempts')->default(0); 30 | $table->boolean('suspended')->default(0); 31 | $table->boolean('banned')->default(0); 32 | $table->timestamp('last_attempt_at')->nullable(); 33 | $table->timestamp('suspended_at')->nullable(); 34 | $table->timestamp('banned_at')->nullable(); 35 | 36 | // We'll need to ensure that MySQL uses the InnoDB engine to 37 | // support the indexes, other engines aren't affected. 38 | $table->engine = 'InnoDB'; 39 | $table->index('user_id'); 40 | }); 41 | } 42 | 43 | /** 44 | * Reverse the migrations. 45 | * 46 | * @return void 47 | */ 48 | public function down() 49 | { 50 | Schema::drop('throttle'); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_093020_update_users_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the update users table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class UpdateUsersTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::table('users', function (Blueprint $table) { 31 | $table->softDeletes(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::table('users', function (Blueprint $table) { 43 | $table->dropSoftDeletes(); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_093021_update_groups_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the update groups table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class UpdateGroupsTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::table('groups', function (Blueprint $table) { 31 | $table->softDeletes(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::table('groups', function (Blueprint $table) { 43 | $table->dropSoftDeletes(); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_093030_create_revisions_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the create revisions table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CreateRevisionsTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::create('revisions', function (Blueprint $table) { 31 | $table->increments('id'); 32 | $table->string('revisionable_type'); 33 | $table->integer('revisionable_id'); 34 | $table->integer('user_id')->nullable(); 35 | $table->string('key'); 36 | $table->text('old_value')->nullable(); 37 | $table->text('new_value')->nullable(); 38 | $table->timestamps(); 39 | $table->softDeletes(); 40 | 41 | $table->index(['revisionable_id', 'revisionable_type']); 42 | }); 43 | } 44 | 45 | /** 46 | * Reverse the migrations. 47 | * 48 | * @return void 49 | */ 50 | public function down() 51 | { 52 | Schema::drop('revisions'); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_110721_create_pages_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the create pages table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CreatePagesTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::create('pages', function (Blueprint $table) { 31 | $table->engine = 'InnoDB'; 32 | $table->increments('id')->unsigned(); 33 | $table->string('title'); 34 | $table->string('nav_title'); 35 | $table->string('slug'); 36 | $table->text('body'); 37 | $table->text('css')->nullable(); 38 | $table->text('js')->nullable(); 39 | $table->boolean('show_title')->default(true); 40 | $table->boolean('show_nav')->default(true); 41 | $table->string('icon')->default(''); 42 | $table->integer('user_id')->unsigned(); 43 | $table->timestamps(); 44 | $table->softDeletes(); 45 | }); 46 | } 47 | 48 | /** 49 | * Reverse the migrations. 50 | * 51 | * @return void 52 | */ 53 | public function down() 54 | { 55 | Schema::drop('pages'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_110722_create_posts_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the create pages table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CreatePostsTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::create('posts', function (Blueprint $table) { 31 | $table->engine = 'InnoDB'; 32 | $table->increments('id')->unsigned(); 33 | $table->string('title'); 34 | $table->string('summary'); 35 | $table->text('body'); 36 | $table->integer('user_id')->unsigned(); 37 | $table->timestamps(); 38 | $table->softDeletes(); 39 | }); 40 | } 41 | 42 | /** 43 | * Reverse the migrations. 44 | * 45 | * @return void 46 | */ 47 | public function down() 48 | { 49 | Schema::drop('posts'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_110723_create_comments_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the create pages table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CreateCommentsTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::create('comments', function (Blueprint $table) { 31 | $table->engine = 'InnoDB'; 32 | $table->increments('id')->unsigned(); 33 | $table->text('body'); 34 | $table->integer('version')->unsigned()->default(1); 35 | $table->integer('user_id')->unsigned(); 36 | $table->integer('post_id')->unsigned(); 37 | $table->timestamps(); 38 | $table->softDeletes(); 39 | }); 40 | } 41 | 42 | /** 43 | * Reverse the migrations. 44 | * 45 | * @return void 46 | */ 47 | public function down() 48 | { 49 | Schema::drop('comments'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /database/migrations/2014_07_19_110724_create_events_table.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Migrations\Migration; 13 | use Illuminate\Database\Schema\Blueprint; 14 | use Illuminate\Support\Facades\Schema; 15 | 16 | /** 17 | * This is the create pages table migration class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class CreateEventsTable extends Migration 22 | { 23 | /** 24 | * Run the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function up() 29 | { 30 | Schema::create('events', function (Blueprint $table) { 31 | $table->engine = 'InnoDB'; 32 | $table->increments('id')->unsigned(); 33 | $table->string('title'); 34 | $table->text('body'); 35 | $table->timestamp('date'); 36 | $table->text('location'); 37 | $table->integer('user_id')->unsigned(); 38 | $table->timestamps(); 39 | $table->softDeletes(); 40 | }); 41 | } 42 | 43 | /** 44 | * Reverse the migrations. 45 | * 46 | * @return void 47 | */ 48 | public function down() 49 | { 50 | Schema::drop('events'); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Illuminate\Database\Eloquent\Model as Eloquent; 13 | use Illuminate\Database\Seeder; 14 | 15 | /** 16 | * This is the database seeder class. 17 | * 18 | * @author Graham Campbell 19 | */ 20 | class DatabaseSeeder extends Seeder 21 | { 22 | /** 23 | * Run the database seeding. 24 | * 25 | * @return void 26 | */ 27 | public function run() 28 | { 29 | Eloquent::unguard(); 30 | 31 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\GroupsTableSeeder'); 32 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\UsersTableSeeder'); 33 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\UsersGroupsTableSeeder'); 34 | 35 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\PagesTableSeeder'); 36 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\PostsTableSeeder'); 37 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\CommentsTableSeeder'); 38 | $this->call('GrahamCampbell\BootstrapCMS\Seeds\EventsTableSeeder'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | process.env.DISABLE_NOTIFIER = true 2 | 3 | var elixir = require('laravel-elixir'); 4 | 5 | stylesPath = 'public/assets/styles/'; 6 | scriptsPath = 'public/assets/scripts/'; 7 | 8 | elixir.config.css.outputFolder = stylesPath; 9 | elixir.config.js.outputFolder = scriptsPath; 10 | elixir.config.sourcemaps = false; 11 | 12 | elixir(function (mix) { 13 | mix.copy('resources/assets/css/bootstrap.*.min.css', stylesPath); 14 | mix.styles(['bootstrap.min.css'], stylesPath + 'bootstrap.default.min.css'); 15 | mix.styles(['bootstrap.min.css', 'bootstrap-theme.min.css'], stylesPath + 'bootstrap.legacy.min.css'); 16 | 17 | mix.styles(['cms-main.css'], stylesPath + 'cms-main.css'); 18 | 19 | mix.scripts(['cms-timeago.js', 'cms-restfulizer.js', 'cms-carousel.js', 'cms-alerts.js'], scriptsPath + 'cms-main.js'); 20 | mix.scripts(['cms-picker.js'], scriptsPath + 'cms-picker.js'); 21 | mix.scripts(['cms-comment-core.js', 'cms-comment-edit.js', 'cms-comment-delete.js', 'cms-comment-create.js', 'cms-comment-fetch.js', 'cms-comment-main.js'], scriptsPath + 'cms-comment.js'); 22 | }); 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "gulp": "~3.9.0", 4 | "laravel-elixir": "~3.1.1" 5 | }, 6 | "private": true 7 | } 8 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | ./tests 19 | 20 | 21 | 22 | 23 | ./app 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | RewriteRule ^(.*)/$ /$1 [L,R=301] 9 | 10 | RewriteCond %{REQUEST_FILENAME} !-d 11 | RewriteCond %{REQUEST_FILENAME} !-f 12 | RewriteRule ^ index.php [L] 13 | 14 | -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/public/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/public/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/public/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/public/assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/assets/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/assets/styles/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BootstrapCMS/CMS/c27e465785bca5eb8604221ac5768ce480544ed7/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels nice to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../bootstrap/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); 53 | $request = Illuminate\Http\Request::capture(); 54 | $response = $kernel->handle($request); 55 | 56 | $response->send(); 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /public/packages/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * Allow: / 2 | -------------------------------------------------------------------------------- /resources/assets/css/BOOTSTRAP-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2014 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /resources/assets/css/cms-main.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | } 5 | 6 | #wrap { 7 | min-height: 100%; 8 | height: auto !important; 9 | height: 100%; 10 | margin: 0 auto -60px; 11 | padding: 0 0 60px; 12 | } 13 | 14 | #wrap > .container { 15 | padding: 60px 15px; 16 | } 17 | 18 | .navbar { 19 | padding-right: 5px; 20 | padding-left: 5px; 21 | } 22 | 23 | .navbar-right { 24 | padding-right: 20px; 25 | padding-left: 5px; 26 | } 27 | 28 | #footer { 29 | height: 60px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | #footer > .container { 34 | padding-left: 15px; 35 | padding-right: 15px; 36 | } 37 | 38 | .container .credit { 39 | margin: 20px 0; 40 | } 41 | 42 | .jumbotron { 43 | background-color: transparent; 44 | text-align: center; 45 | } 46 | 47 | .hidden-xs .jumbotron { 48 | margin: 28px 0; 49 | } 50 | 51 | .visible-xs .jumbotron { 52 | margin: 20px 0; 53 | } 54 | 55 | .jumbotron h1 { 56 | line-height: 1; 57 | } 58 | 59 | .hidden-xs .jumbotron .hidden-sm h1 { 60 | font-size: 100px; 61 | } 62 | 63 | .hidden-xs .jumbotron .visible-sm h1 { 64 | font-size: 80px; 65 | } 66 | 67 | .visible-xs .jumbotron h1 { 68 | font-size: 60px; 69 | } 70 | 71 | .jumbotron .lead { 72 | line-height: 1.25; 73 | } 74 | 75 | .hidden-xs .jumbotron .lead { 76 | font-size: 24px; 77 | } 78 | 79 | .visible-xs .jumbotron .lead { 80 | font-size: 20px; 81 | } 82 | 83 | .hidden-xs .jumbotron .btn { 84 | font-size: 21px; 85 | padding: 14px 24px; 86 | } 87 | 88 | .visible-xs .jumbotron .btn { 89 | font-size: 20px; 90 | padding: 12px 18px; 91 | } 92 | 93 | .comment-box { 94 | resize: none; 95 | } 96 | 97 | .comment-button { 98 | margin-top:15px; 99 | margin-bottom:10px; 100 | } 101 | 102 | .carousel-fade .carousel-inner .item { 103 | opacity: 0; 104 | -webkit-transition-property: opacity; 105 | -moz-transition-property: opacity; 106 | -o-transition-property: opacity; 107 | transition-property: opacity; 108 | } 109 | .carousel-fade .carousel-inner .active { 110 | opacity: 1; 111 | } 112 | .carousel-fade .carousel-inner .active.left, 113 | .carousel-fade .carousel-inner .active.right { 114 | left: 0; 115 | opacity: 0; 116 | z-index: 1; 117 | } 118 | .carousel-fade .carousel-inner .next.left, 119 | .carousel-fade .carousel-inner .prev.right { 120 | opacity: 1; 121 | } 122 | .carousel-fade .carousel-control { 123 | z-index: 2; 124 | } 125 | -------------------------------------------------------------------------------- /resources/assets/js/cms-alerts.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | setTimeout(function() { 3 | alerts = $('.cms-alert'); 4 | alerts.addClass('bounceOut'); 5 | alerts.addClass('animated'); 6 | setTimeout(function() { 7 | alerts.slideUp(500, function() { 8 | alerts.remove(); 9 | }); 10 | }, 500); 11 | }, 2500); 12 | }); 13 | -------------------------------------------------------------------------------- /resources/assets/js/cms-carousel.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('.carousel').carousel({ 3 | interval: 2500 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /resources/assets/js/cms-comment-core.js: -------------------------------------------------------------------------------- 1 | var cmsCommentLock = true; 2 | -------------------------------------------------------------------------------- /resources/assets/js/cms-comment-delete.js: -------------------------------------------------------------------------------- 1 | function cmsCommentDeleteSubmit(that) { 2 | $.ajax({ 3 | url: $(that).attr("href"), 4 | type: "DELETE", 5 | dataType: "json", 6 | timeout: 5000, 7 | success: function(data, status, xhr) { 8 | if (!xhr.responseJSON) { 9 | cmsCommentLock = false; 10 | return; 11 | } 12 | if (xhr.responseJSON.success !== true || !xhr.responseJSON.msg || !xhr.responseJSON.comment_id) { 13 | cmsCommentLock = false; 14 | return; 15 | } 16 | $("#comment_"+xhr.responseJSON.comment_id).slideUp(cmsCommentTime, function() { 17 | $(this).remove(); 18 | if ($("#comments > div").length == 0 && $("#comments > p").length == 0) { 19 | $("

There are currently no comments.

").prependTo("#comments").hide().fadeIn(cmsCommentTime, function() { 20 | cmsCommentLock = false; 21 | }); 22 | } else { 23 | cmsCommentLock = false; 24 | } 25 | }); 26 | }, 27 | error: function(xhr, status, error) { 28 | cmsCommentLock = false; 29 | } 30 | }); 31 | } 32 | 33 | function cmsCommentDelete(bindval) { 34 | bindval = bindval || ".deletable"; 35 | $(bindval).click(function() { 36 | var that = this; 37 | var cmsCommentDeleteCheck = setInterval(function() { 38 | if (cmsCommentLock == false) { 39 | clearInterval(cmsCommentDeleteCheck); 40 | cmsCommentLock = true; 41 | cmsCommentDeleteSubmit(that); 42 | } 43 | }, 10); 44 | return false; 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /resources/assets/js/cms-comment-main.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | cmsCommentEdit(); 3 | cmsCommentModel(); 4 | cmsCommentDelete(); 5 | cmsCommentCreate(); 6 | cmsCommentFetch(); 7 | cmsCommentLock = false; 8 | }); 9 | -------------------------------------------------------------------------------- /resources/assets/js/cms-picker.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#datetimepicker1').datetimepicker({ 3 | format: js_datetime_format 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /resources/assets/js/cms-restfulizer.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('[data-method]').not(".disabled").append(function () { 3 | var methodForm = "\n" 4 | methodForm += "
\n" 5 | methodForm += " \n" 6 | if ($(this).attr('data-token')) { 7 | methodForm += "\n" 8 | } 9 | methodForm += "
\n" 10 | return methodForm 11 | }) 12 | .removeAttr('href') 13 | .attr('onclick', ' if ($(this).hasClass(\'action_confirm\')) { if(confirm("Are you sure you want to do this?")) { $(this).find("form").submit(); } } else { $(this).find("form").submit(); }'); 14 | }); 15 | -------------------------------------------------------------------------------- /resources/assets/js/cms-timeago.js: -------------------------------------------------------------------------------- 1 | function cmsTimeAgo(bindval) { 2 | bindval = bindval || "abbr.timeago"; 3 | $(bindval).timeago(); 4 | } 5 | 6 | $(document).ready(cmsTimeAgo()); 7 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Authentication Language Lines 17 | |-------------------------------------------------------------------------- 18 | | 19 | | The following language lines are used during authentication for various 20 | | messages that we need to display to the user. You are free to modify 21 | | these language lines according to your application's requirements. 22 | | 23 | */ 24 | 25 | 'failed' => 'These credentials do not match our records.', 26 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 27 | 28 | ]; 29 | -------------------------------------------------------------------------------- /resources/lang/en/messages.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'view_error' => 'The post you were viewing has been deleted.', 13 | 'store_success' => 'Comment created successfully.', 14 | 'update_success' => 'Comment updated successfully.', 15 | 'delete_success' => 'Comment deleted successfully.', 16 | ], 17 | 18 | 'event' => [ 19 | 'store_success' => 'Your event has been created successfully.', 20 | 'update_success' => 'Your event has been updated successfully.', 21 | 'delete_success' => 'Your event has been deleted successfully.', 22 | ], 23 | 24 | 'page' => [ 25 | 'store_success' => 'Your page has been created successfully.', 26 | 'update_success' => 'Your page has been updated successfully.', 27 | 'delete_success' => 'Your page has been deleted successfully.', 28 | 'delete_error' => 'You cannot delete this page.', 29 | 'homepage_slug' => 'You cannot change the homepage slug.', 30 | 'show_nav' => 'The homepage must remain on the navigation bar.', 31 | ], 32 | 33 | 'post' => [ 34 | 'store_success' => 'Your post has been created successfully.', 35 | 'update_success' => 'Your post has been updated successfully.', 36 | 'delete_success' => 'Your post has been deleted successfully.', 37 | ], 38 | ]; 39 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Pagination Language Lines 17 | |-------------------------------------------------------------------------- 18 | | 19 | | The following language lines are used by the paginator library to build 20 | | the simple pagination links. You are free to change them to anything 21 | | you want to customize your views to better match your application. 22 | | 23 | */ 24 | 25 | 'previous' => '« Previous', 26 | 'next' => 'Next »', 27 | 28 | ]; 29 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Password Reminder Language Lines 17 | |-------------------------------------------------------------------------- 18 | | 19 | | The following language lines are the default lines which match reasons 20 | | that are given by the password broker for a password update attempt 21 | | has failed, such as for an invalid token or invalid new password. 22 | | 23 | */ 24 | 25 | 'password' => 'Passwords must be at least six characters and match the confirmation.', 26 | 'reset' => 'Your password has been reset!', 27 | 'sent' => 'We have e-mailed your password reset link!', 28 | 'token' => 'This password reset token is invalid.', 29 | 'user' => "We can't find a user with that e-mail address.", 30 | 31 | ]; 32 | -------------------------------------------------------------------------------- /resources/views/events/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Create Event 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 | URL::route('events.store'), 17 | 'method' => 'POST', 18 | 'button' => 'Create New Event', 19 | 'defaults' => [ 20 | 'title' => '', 21 | 'date' => Carbon\Carbon::now()->addMinutes(30)->format(Config::get('date.php_format')), 22 | 'location' => '', 23 | 'body' => '', 24 | ], ]; 25 | ?> 26 | @include('events.form') 27 |
28 | @stop 29 | 30 | @section('css') 31 | 32 | 33 | @stop 34 | 35 | @section('js') 36 | 37 | 38 | 39 | 42 | 43 | @stop 44 | -------------------------------------------------------------------------------- /resources/views/events/delete.blade.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /resources/views/events/deletes.blade.php: -------------------------------------------------------------------------------- 1 | @foreach ($events as $event) 2 | 20 | @endforeach 21 | -------------------------------------------------------------------------------- /resources/views/events/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Edit {{ $event->title }} 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 |
16 |

17 | Please edit the event: 18 |

19 |
20 |
21 | 24 |
25 |
26 |
27 |
28 | URL::route('events.update', ['events' => $event->id]), 30 | '_method' => 'PATCH', 31 | 'method' => 'POST', 32 | 'button' => 'Save Event', 33 | 'defaults' => [ 34 | 'title' => $event->title, 35 | 'date' => $event->date->format(Config::get('date.php_format')), 36 | 'location' => $event->location, 37 | 'body' => $event->body, 38 | ], ]; 39 | ?> 40 | @include('events.form') 41 |
42 | @stop 43 | 44 | @section('bottom') 45 | @auth('edit') 46 | @include('events.delete') 47 | @endauth 48 | @stop 49 | 50 | @section('css') 51 | 52 | 53 | @stop 54 | 55 | @section('js') 56 | 57 | 58 | 59 | 62 | 63 | @stop 64 | -------------------------------------------------------------------------------- /resources/views/events/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Events 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 |
16 |

17 | @if (count($events) == 0) 18 | There are currently no events. 19 | @else 20 | Here you may find our events: 21 | @endif 22 |

23 |
24 | @auth('edit') 25 |
26 |
27 | New Event 28 |
29 |
30 | @endauth 31 |
32 | @foreach($events as $event) 33 |

{!! $event->title !!}

34 |

35 | {!! $event->date->format(Config::get('date.php_display_format')) !!} 36 |

37 |

38 | Show Event 39 | @auth('edit') 40 | Edit Event Delete Event 41 | @endauth 42 |

43 |
44 | @endforeach 45 | {!! $links !!} 46 | @stop 47 | 48 | @section('bottom') 49 | @auth('edit') 50 | @include('events.deletes') 51 | @endauth 52 | @stop 53 | -------------------------------------------------------------------------------- /resources/views/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ Config::get('app.name') }} - @section('title') 7 | @show 8 | @include('partials.header') 9 | 10 | 11 |
12 | @navigation 13 |
14 | @section('top') 15 | @show 16 | @include('partials.notifications') 17 | @section('content') 18 | @show 19 | @include('partials.footer') 20 | @section('bottom') 21 | @show 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/views/layouts/email.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

{{ $subject }}

8 | @section('content') 9 | @show 10 |
11 |

12 | Thank you,
13 | The Support Team 14 |

15 | 16 | 17 | -------------------------------------------------------------------------------- /resources/views/maintenance.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Site Maintenance 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 |

We'll be back soon!

22 |
23 |

24 | Sorry for the inconvenience, but we're performing some maintenance at 25 | the moment. Most site maintenance takes under 5 minutes, so you can 26 | expect us to be back online shortly! 27 |

28 |

29 | — The Web Team 30 |

31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /resources/views/pages/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Create Page 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 | URL::route('pages.store'), 17 | 'method' => 'POST', 18 | 'button' => 'Create New Page', 19 | 'defaults' => [ 20 | 'title' => '', 21 | 'nav_title' => '', 22 | 'slug' => '', 23 | 'icon' => '', 24 | 'body' => '', 25 | 'css' => '', 26 | 'js' => '', 27 | 'show_title' => true, 28 | 'show_nav' => true, 29 | ], ]; 30 | ?> 31 | @include('pages.form') 32 |
33 | @stop 34 | 35 | @section('css') 36 | 37 | @stop 38 | 39 | @section('js') 40 | 41 | 56 | @stop 57 | -------------------------------------------------------------------------------- /resources/views/pages/delete.blade.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /resources/views/pages/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Edit {{ $page->title }} 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 |
16 |

17 | Please edit the page: 18 |

19 |
20 |
21 | 24 |
25 |
26 |
27 |
28 | URL::route('pages.update', ['pages' => $page->slug]), 30 | '_method' => 'PATCH', 31 | 'method' => 'POST', 32 | 'button' => 'Save Page', 33 | 'defaults' => [ 34 | 'title' => $page->title, 35 | 'nav_title' => $page->nav_title, 36 | 'slug' => $page->slug, 37 | 'icon' => $page->icon, 38 | 'body' => $page->body, 39 | 'css' => $page->css, 40 | 'js' => $page->js, 41 | 'show_title' => ($page->show_title == true), 42 | 'show_nav' => ($page->show_nav == true), 43 | ], ]; 44 | ?> 45 | @include('pages.form') 46 |
47 | @stop 48 | 49 | @section('bottom') 50 | @auth('edit') 51 | @include('pages.delete') 52 | @endauth 53 | @stop 54 | 55 | @section('css') 56 | 57 | @stop 58 | 59 | @section('js') 60 | 61 | 66 | @stop 67 | -------------------------------------------------------------------------------- /resources/views/pages/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | {{ $page->title }} 5 | @stop 6 | 7 | @section('top') 8 | @if($page->show_title) 9 | 12 | @endif 13 | @stop 14 | 15 | @section('content') 16 | @auth('edit') 17 |
18 | 36 |
37 |
38 |

39 | Page Owner: {!! $page->owner !!} 40 |

41 |

42 | Page Created: {!! html_ago($page->created_at) !!} 43 |

44 |

45 | Last Updated: {!! html_ago($page->updated_at) !!} 46 |

47 | Edit Page Delete Page 48 |
49 |
50 |
51 |
52 | @endauth 53 | @if (Config::get('cms.eval', false)) 54 | '.$page->body); ?> 55 | @else 56 | {!! $page->body !!} 57 | @endif 58 | @stop 59 | 60 | @section('bottom') 61 | @auth('edit') 62 | @include('pages.delete') 63 | @endauth 64 | @stop 65 | 66 | @section('css') 67 | {!! $page->css !!} 68 | @stop 69 | 70 | @section('js') 71 | {!! $page->js !!} 72 | @stop 73 | -------------------------------------------------------------------------------- /resources/views/partials/analytics.blade.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /resources/views/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 24 | 25 | 26 | 27 | 28 | 29 | @section('js') 30 | @show 31 | @if (Config::get('analytics.google')) 32 | @include('partials.analytics') 33 | @endif 34 | -------------------------------------------------------------------------------- /resources/views/partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | @section('css') 11 | @show 12 | 13 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /resources/views/partials/notifications.blade.php: -------------------------------------------------------------------------------- 1 | @if (isset($errors) && count($errors->all()) > 0) 2 |
3 | × 4 | Please check the form below for errors 5 |
6 | @endif 7 | 8 | 9 | 10 | @foreach ($types as $type) 11 | @if ($message = Session::get($type)) 12 | 13 |
14 | × 15 | {!! $message !!} 16 |
17 | @endif 18 | @endforeach 19 | -------------------------------------------------------------------------------- /resources/views/partials/title.blade.php: -------------------------------------------------------------------------------- 1 | @if (!isset($hide_title)) 2 | 8 | @endif 9 | -------------------------------------------------------------------------------- /resources/views/posts/comment.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @auth('mod') 3 |
4 |

{!! $comment->author !!} - {!! html_ago($comment->created_at, 'timeago_comment_'.$comment->id) !!}

5 |

{!! nl2br(e($comment->body)) !!}

6 |
7 | 14 |
15 |
16 | Edit Delete 17 |
18 |
19 | @else 20 |
21 |

{!! $comment->author !!} - {!! html_ago($comment->created_at, 'timeago_comment_'.$comment->id) !!}

22 |

{!! nl2br(e($comment->body)) !!}

23 |
24 | @endauth 25 |
26 | -------------------------------------------------------------------------------- /resources/views/posts/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Create Post 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 | URL::route('blog.posts.store'), 17 | 'method' => 'POST', 18 | 'button' => 'Create New Post', 19 | 'defaults' => [ 20 | 'title' => '', 21 | 'summary' => '', 22 | 'body' => '', 23 | ], ]; 24 | ?> 25 | @include('posts.form') 26 |
27 | @stop 28 | 29 | @section('css') 30 | 31 | @stop 32 | 33 | @section('js') 34 | 35 | @stop 36 | -------------------------------------------------------------------------------- /resources/views/posts/delete.blade.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /resources/views/posts/deletes.blade.php: -------------------------------------------------------------------------------- 1 | @foreach ($posts as $post) 2 | 20 | @endforeach 21 | -------------------------------------------------------------------------------- /resources/views/posts/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Edit {{ $post->title }} 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 |
16 |

17 | Please edit the post: 18 |

19 |
20 |
21 | 24 |
25 |
26 |
27 |
28 | URL::route('blog.posts.update', ['posts' => $post->id]), 30 | '_method' => 'PATCH', 31 | 'method' => 'POST', 32 | 'button' => 'Save Post', 33 | 'defaults' => [ 34 | 'title' => $post->title, 35 | 'summary' => $post->summary, 36 | 'body' => $post->body, 37 | ], ]; 38 | ?> 39 | @include('posts.form') 40 |
41 | @stop 42 | 43 | @section('bottom') 44 | @auth('blog') 45 | @include('posts.delete') 46 | @endauth 47 | @stop 48 | 49 | @section('css') 50 | 51 | @stop 52 | 53 | @section('js') 54 | 55 | @stop 56 | -------------------------------------------------------------------------------- /resources/views/posts/form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{ csrf_field() }} 4 | 5 | 6 |
7 | 8 |
9 | 10 | {!! ($errors->has('title') ? $errors->first('title') : '') !!} 11 |
12 |
13 | 14 |
15 | 16 |
17 | 18 | {!! ($errors->has('summary') ? $errors->first('summary') : '') !!} 19 |
20 |
21 | 22 |
23 | 24 |
25 | 26 | {!! ($errors->has('body') ? $errors->first('body') : '') !!} 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 |
37 | -------------------------------------------------------------------------------- /resources/views/posts/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('title') 4 | Blog 5 | @stop 6 | 7 | @section('top') 8 | 11 | @stop 12 | 13 | @section('content') 14 |
15 |
16 |

17 | @if (count($posts) == 0) 18 | There are currently no blog posts. 19 | @else 20 | Here you may find our blog posts: 21 | @endif 22 |

23 |
24 | @auth('blog') 25 |
26 |
27 | New Post 28 |
29 |
30 | @endauth 31 |
32 | @foreach($posts as $post) 33 |

{!! $post->title !!}

34 |

35 | {!! $post->summary !!} 36 |

37 |

38 | Show Post 39 | @auth('blog') 40 | Edit Post Delete Post 41 | @endauth 42 |

43 |
44 | @endforeach 45 | {!! $links !!} 46 | @stop 47 | 48 | @section('bottom') 49 | @auth('blog') 50 | @include('posts.deletes') 51 | @endauth 52 | @stop 53 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); 13 | 14 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 15 | return false; 16 | } 17 | 18 | require_once __DIR__.'/public/index.php'; 19 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | down 8 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/AbstractTestCase.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS; 13 | 14 | use GrahamCampbell\BootstrapCMS\Providers\AppServiceProvider; 15 | use GrahamCampbell\TestBenchCore\MockeryTrait; 16 | use Illuminate\Contracts\Console\Kernel; 17 | use Illuminate\Foundation\Testing\TestCase; 18 | 19 | /** 20 | * This is the abstract test case class. 21 | * 22 | * @author Graham Campbell 23 | */ 24 | abstract class AbstractTestCase extends TestCase 25 | { 26 | use MockeryTrait; 27 | 28 | /** 29 | * The base URL to use while testing the application. 30 | * 31 | * @var string 32 | */ 33 | protected $baseUrl = 'http://localhost'; 34 | 35 | /** 36 | * Get the service provider class. 37 | * 38 | * @param \Illuminate\Contracts\Foundation\Application $app 39 | * 40 | * @return string 41 | */ 42 | protected function getServiceProviderClass($app) 43 | { 44 | return AppServiceProvider::class; 45 | } 46 | 47 | /** 48 | * Creates the application. 49 | * 50 | * @return \Illuminate\Foundation\Application 51 | */ 52 | public function createApplication() 53 | { 54 | $app = require __DIR__.'/../bootstrap/app.php'; 55 | 56 | $app->make(Kernel::class)->bootstrap(); 57 | 58 | return $app; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /tests/Acceptance/AbstractTestCase.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Acceptance; 13 | 14 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase as BaseTestCase; 15 | use Illuminate\Contracts\Console\Kernel; 16 | 17 | /** 18 | * This is the abstract test case class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | abstract class AbstractTestCase extends BaseTestCase 23 | { 24 | /** 25 | * @before 26 | */ 27 | public function runInstallCommand() 28 | { 29 | $this->app->make(Kernel::class)->call('app:install'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/Acceptance/CommentTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Acceptance; 13 | 14 | use GrahamCampbell\BootstrapCMS\Facades\PostRepository; 15 | 16 | /** 17 | * This is the comment test class. 18 | * 19 | * @group comment 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class CommentTest extends AbstractTestCase 24 | { 25 | public function testIndexFail() 26 | { 27 | PostRepository::shouldReceive('find')->once()->with(1, ['id']); 28 | 29 | $this->get('blog/posts/1/comments'); 30 | 31 | $this->assertEquals(404, $this->response->status()); 32 | } 33 | 34 | public function testIndexSuccess() 35 | { 36 | $this->visit('blog/posts/1/comments')->see('[{"comment_id":"1","comment_ver":"1"}]'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tests/BasicTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS; 13 | 14 | use Illuminate\Contracts\Console\Kernel; 15 | 16 | /** 17 | * This is the basic test class. 18 | * 19 | * @author Graham Campbell 20 | */ 21 | class BasicTest extends AbstractTestCase 22 | { 23 | /** 24 | * @before 25 | */ 26 | public function runInstallCommand() 27 | { 28 | $this->app->make(Kernel::class)->call('app:install'); 29 | } 30 | 31 | public function testBase() 32 | { 33 | $this->visit('/')->seePageIs('pages/home'); 34 | } 35 | 36 | public function testBlog() 37 | { 38 | $this->visit('blog')->seePageIs('blog/posts'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/Facades/CommentRepositoryTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Facades; 13 | 14 | use GrahamCampbell\TestBenchCore\FacadeTrait; 15 | use GrahamCampbell\TestBenchCore\HelperTrait; 16 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 17 | 18 | /** 19 | * This is the comment repository facade test class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class CommentRepositoryTest extends AbstractTestCase 24 | { 25 | use FacadeTrait, HelperTrait; 26 | 27 | /** 28 | * Get the facade accessor. 29 | * 30 | * @return string 31 | */ 32 | protected function getFacadeAccessor() 33 | { 34 | return 'commentrepository'; 35 | } 36 | 37 | /** 38 | * Get the facade class. 39 | * 40 | * @return string 41 | */ 42 | protected function getFacadeClass() 43 | { 44 | return 'GrahamCampbell\BootstrapCMS\Facades\CommentRepository'; 45 | } 46 | 47 | /** 48 | * Get the facade route. 49 | * 50 | * @return string 51 | */ 52 | protected function getFacadeRoot() 53 | { 54 | return 'GrahamCampbell\BootstrapCMS\Repositories\CommentRepository'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Facades/EventRepositoryTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Facades; 13 | 14 | use GrahamCampbell\TestBenchCore\FacadeTrait; 15 | use GrahamCampbell\TestBenchCore\HelperTrait; 16 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 17 | 18 | /** 19 | * This is the event repository facade test class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class EventRepositoryTest extends AbstractTestCase 24 | { 25 | use FacadeTrait, HelperTrait; 26 | 27 | /** 28 | * Get the facade accessor. 29 | * 30 | * @return string 31 | */ 32 | protected function getFacadeAccessor() 33 | { 34 | return 'eventrepository'; 35 | } 36 | 37 | /** 38 | * Get the facade class. 39 | * 40 | * @return string 41 | */ 42 | protected function getFacadeClass() 43 | { 44 | return 'GrahamCampbell\BootstrapCMS\Facades\EventRepository'; 45 | } 46 | 47 | /** 48 | * Get the facade route. 49 | * 50 | * @return string 51 | */ 52 | protected function getFacadeRoot() 53 | { 54 | return 'GrahamCampbell\BootstrapCMS\Repositories\EventRepository'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Facades/NavigationFactoryTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Facades; 13 | 14 | use GrahamCampbell\TestBenchCore\FacadeTrait; 15 | use GrahamCampbell\TestBenchCore\HelperTrait; 16 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 17 | 18 | /** 19 | * This is the navigation factory facade test class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class NavigationFactoryTest extends AbstractTestCase 24 | { 25 | use FacadeTrait, HelperTrait; 26 | 27 | /** 28 | * Get the facade accessor. 29 | * 30 | * @return string 31 | */ 32 | protected function getFacadeAccessor() 33 | { 34 | return 'navfactory'; 35 | } 36 | 37 | /** 38 | * Get the facade class. 39 | * 40 | * @return string 41 | */ 42 | protected function getFacadeClass() 43 | { 44 | return 'GrahamCampbell\BootstrapCMS\Facades\NavigationFactory'; 45 | } 46 | 47 | /** 48 | * Get the facade route. 49 | * 50 | * @return string 51 | */ 52 | protected function getFacadeRoot() 53 | { 54 | return 'GrahamCampbell\BootstrapCMS\Navigation\Factory'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Facades/PageRepositoryTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Facades; 13 | 14 | use GrahamCampbell\TestBenchCore\FacadeTrait; 15 | use GrahamCampbell\TestBenchCore\HelperTrait; 16 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 17 | 18 | /** 19 | * This is the page repository facade test class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class PageRepositoryTest extends AbstractTestCase 24 | { 25 | use FacadeTrait, HelperTrait; 26 | 27 | /** 28 | * Get the facade accessor. 29 | * 30 | * @return string 31 | */ 32 | protected function getFacadeAccessor() 33 | { 34 | return 'pagerepository'; 35 | } 36 | 37 | /** 38 | * Get the facade class. 39 | * 40 | * @return string 41 | */ 42 | protected function getFacadeClass() 43 | { 44 | return 'GrahamCampbell\BootstrapCMS\Facades\PageRepository'; 45 | } 46 | 47 | /** 48 | * Get the facade route. 49 | * 50 | * @return string 51 | */ 52 | protected function getFacadeRoot() 53 | { 54 | return 'GrahamCampbell\BootstrapCMS\Repositories\PageRepository'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Facades/PostRepositoryTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Facades; 13 | 14 | use GrahamCampbell\TestBenchCore\FacadeTrait; 15 | use GrahamCampbell\TestBenchCore\HelperTrait; 16 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 17 | 18 | /** 19 | * This is the post repository facade test class. 20 | * 21 | * @author Graham Campbell 22 | */ 23 | class PostRepositoryTest extends AbstractTestCase 24 | { 25 | use FacadeTrait, HelperTrait; 26 | 27 | /** 28 | * Get the facade accessor. 29 | * 30 | * @return string 31 | */ 32 | protected function getFacadeAccessor() 33 | { 34 | return 'postrepository'; 35 | } 36 | 37 | /** 38 | * Get the facade class. 39 | * 40 | * @return string 41 | */ 42 | protected function getFacadeClass() 43 | { 44 | return 'GrahamCampbell\BootstrapCMS\Facades\PostRepository'; 45 | } 46 | 47 | /** 48 | * Get the facade route. 49 | * 50 | * @return string 51 | */ 52 | protected function getFacadeRoot() 53 | { 54 | return 'GrahamCampbell\BootstrapCMS\Repositories\PostRepository'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Functional/CommandTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS\Functional; 13 | 14 | use GrahamCampbell\Tests\BootstrapCMS\AbstractTestCase; 15 | use Illuminate\Contracts\Console\Kernel; 16 | 17 | /** 18 | * This is the command test class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class CommandTest extends AbstractTestCase 23 | { 24 | public function testInstall() 25 | { 26 | $this->assertSame(0, $this->app->make(Kernel::class)->call('app:install')); 27 | } 28 | 29 | public function testReset() 30 | { 31 | $this->assertSame(0, $this->app->make(Kernel::class)->call('migrate', ['--force' => true])); 32 | $this->assertSame(0, $this->app->make(Kernel::class)->call('app:reset')); 33 | } 34 | 35 | public function testUpdate() 36 | { 37 | $this->assertSame(0, $this->app->make(Kernel::class)->call('app:update')); 38 | } 39 | 40 | public function testResetAfterInstall() 41 | { 42 | $this->assertSame(0, $this->app->make(Kernel::class)->call('app:install')); 43 | $this->assertSame(0, $this->app->make(Kernel::class)->call('app:reset')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/ServiceProviderTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace GrahamCampbell\Tests\BootstrapCMS; 13 | 14 | use GrahamCampbell\TestBenchCore\LaravelTrait; 15 | use GrahamCampbell\TestBenchCore\ServiceProviderTrait; 16 | 17 | /** 18 | * This is the service provider test class. 19 | * 20 | * @author Graham Campbell 21 | */ 22 | class ServiceProviderTest extends AbstractTestCase 23 | { 24 | use LaravelTrait, ServiceProviderTrait; 25 | 26 | public function testNavigationFactoryIsInjectable() 27 | { 28 | $this->assertIsInjectable('GrahamCampbell\BootstrapCMS\Navigation\Factory'); 29 | } 30 | 31 | public function testCommentRepositoryIsInjectable() 32 | { 33 | $this->assertIsInjectable('GrahamCampbell\BootstrapCMS\Repositories\CommentRepository'); 34 | } 35 | 36 | public function testEventRepositoryIsInjectable() 37 | { 38 | $this->assertIsInjectable('GrahamCampbell\BootstrapCMS\Repositories\EventRepository'); 39 | } 40 | 41 | public function testPageRepositoryIsInjectable() 42 | { 43 | $this->assertIsInjectable('GrahamCampbell\BootstrapCMS\Repositories\PageRepository'); 44 | } 45 | 46 | public function testPostRepositoryIsInjectable() 47 | { 48 | $this->assertIsInjectable('GrahamCampbell\BootstrapCMS\Repositories\PostRepository'); 49 | } 50 | } 51 | --------------------------------------------------------------------------------