├── .gitattributes ├── .gitignore ├── app ├── commands │ └── .gitkeep ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── extend.php │ ├── mail.php │ ├── packages │ │ ├── .gitkeep │ │ └── barryvdh │ │ │ └── laravel-debugbar │ │ │ ├── .gitkeep │ │ │ └── config.php │ ├── queue.php │ ├── remote.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── AccountController.php │ ├── Admin │ │ ├── ArticleResource.php │ │ ├── CategoryResource.php │ │ └── UserResource.php │ ├── AdminController.php │ ├── AuthorityController.php │ ├── BaseController.php │ ├── BaseResource.php │ └── BlogController.php ├── database │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2014_09_09_135540_create_authority_tables.php │ │ └── 2014_09_09_141726_create_blog_tables.php │ ├── production.sqlite │ └── seeds │ │ ├── .gitkeep │ │ ├── AuthorityTablesSeeder.php │ │ ├── BlogTablesSeeder.php │ │ ├── DatabaseSeeder.php │ │ └── PSR │ │ ├── PSR-0.md │ │ ├── PSR-1-basic-coding-standard.md │ │ ├── PSR-2-coding-style-guide.md │ │ └── PSR-3-logger-interface.md ├── filters.php ├── functions.php ├── lang │ ├── en │ │ ├── friendlyDate.php │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php │ └── zh-CN │ │ ├── friendlyDate.php │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── models │ ├── Activation.php │ ├── Article.php │ ├── BaseModel.php │ ├── Category.php │ ├── Comment.php │ ├── PassowrdReminder.php │ └── User.php ├── routes.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── debugbar │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php └── views │ ├── account │ ├── changePassword.blade.php │ ├── changePortrait.blade.php │ ├── index.blade.php │ └── myComments.blade.php │ ├── admin │ ├── article │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── category │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── index.blade.php │ └── user │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ ├── authority │ ├── activationSuccess.blade.php │ ├── email │ │ ├── activation.blade.php │ │ └── forgotPassword.blade.php │ ├── password │ │ ├── remind.blade.php │ │ └── reset.blade.php │ ├── signin.blade.php │ ├── signup.blade.php │ └── signupSuccess.blade.php │ ├── blog │ ├── categoryArticles.blade.php │ ├── index.blade.php │ └── show.blade.php │ ├── l │ ├── .this.is.layouts.dir │ ├── account.blade.php │ ├── admin.blade.php │ ├── authority.blade.php │ ├── base.blade.php │ ├── blog.blade.php │ ├── mail.blade.php │ └── system.blade.php │ ├── p │ ├── .this.is.pagination.dir │ ├── simple.blade.php │ ├── slider-3.blade.php │ └── slider.php │ ├── system │ ├── .this.is.systems.dir │ ├── down.blade.php │ ├── error.blade.php │ └── missing.blade.php │ └── w │ ├── .this.is.widgets.dir │ ├── accountNavbar.blade.php │ ├── adminNavbar.blade.php │ ├── blogNavbar.blade.php │ ├── blogSidebar.blade.php │ ├── googleAnalytics.blade.php │ ├── googleSearch.blade.php │ ├── killIE6.blade.php │ ├── modal.blade.php │ └── notification.blade.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── change-db.md ├── composer.json ├── composer.lock ├── phpunit.xml ├── public ├── .htaccess ├── assets │ ├── bootstrap-2.3.2 │ │ ├── css │ │ │ ├── bootstrap-responsive.css │ │ │ ├── bootstrap-responsive.min.css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.min.css │ │ ├── img │ │ │ ├── glyphicons-halflings-white.png │ │ │ └── glyphicons-halflings.png │ │ └── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ ├── bootstrap-3.0.3 │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ └── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ ├── bootstrap-markdown │ │ ├── README.md │ │ ├── bower.json │ │ ├── css │ │ │ └── bootstrap-markdown.min.css │ │ ├── js │ │ │ ├── bootstrap-markdown.js │ │ │ ├── markdown.js │ │ │ └── to-markdown.js │ │ ├── less │ │ │ └── bootstrap-markdown.less │ │ └── package.json │ ├── bootstrap-switch │ │ ├── css │ │ │ ├── bootstrap2 │ │ │ │ ├── bootstrap-switch.css │ │ │ │ └── bootstrap-switch.min.css │ │ │ └── bootstrap3 │ │ │ │ ├── bootstrap-switch.css │ │ │ │ └── bootstrap-switch.min.css │ │ └── js │ │ │ ├── bootstrap-switch.js │ │ │ └── bootstrap-switch.min.js │ ├── css │ │ ├── main.css │ │ └── normalize.css │ ├── img │ │ ├── .gitignore │ │ └── 5-say-modules.jpg │ └── js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ ├── jquery-2.0.3.min.js │ │ ├── jquery-2.0.3.min.map │ │ ├── main.js │ │ └── plugins.js ├── favicon.ico ├── index.php ├── packages │ ├── .gitkeep │ ├── barryvdh │ │ └── laravel-debugbar │ │ │ ├── debugbar.css │ │ │ ├── debugbar.js │ │ │ ├── icons.png │ │ │ ├── laravel-debugbar.css │ │ │ ├── laravel-icon.png │ │ │ ├── openhandler.css │ │ │ ├── openhandler.js │ │ │ ├── php-icon.png │ │ │ ├── vendor │ │ │ ├── font-awesome │ │ │ │ ├── css │ │ │ │ │ └── font-awesome.min.css │ │ │ │ └── fonts │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ └── fontawesome-webfont.woff │ │ │ └── jquery │ │ │ │ └── jquery.min.js │ │ │ ├── widgets.css │ │ │ └── widgets.js │ └── maximebf │ │ └── php-debugbar │ │ ├── debugbar.css │ │ ├── debugbar.js │ │ ├── icons.png │ │ ├── openhandler.css │ │ ├── openhandler.js │ │ ├── php-icon.png │ │ ├── vendor │ │ ├── font-awesome │ │ │ ├── css │ │ │ │ └── font-awesome.min.css │ │ │ └── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ ├── highlightjs │ │ │ ├── highlight.pack.js │ │ │ └── styles │ │ │ │ └── github.css │ │ └── jquery │ │ │ └── dist │ │ │ └── jquery.min.js │ │ ├── widgets.css │ │ ├── widgets.js │ │ └── widgets │ │ ├── mails │ │ ├── widget.css │ │ └── widget.js │ │ ├── sqlqueries │ │ ├── widget.css │ │ └── widget.js │ │ └── templates │ │ ├── widget.css │ │ └── widget.js ├── portrait │ ├── large │ │ └── .size.220 │ ├── medium │ │ └── .size.128 │ └── small │ │ └── .size.64 ├── readmeAssets │ ├── mx3540D.png │ ├── mx3826D.png │ ├── mx384D1.png │ └── mx3D2BE.png └── robots.txt ├── readme.md └── server.php /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | .env.local.php 5 | .env.php 6 | .DS_Store 7 | Thumbs.db 8 | /modules/temporary.php 9 | /VendorCleanerBackup 10 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/commands/.gitkeep -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'authority.email.forgotPassword', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); 72 | -------------------------------------------------------------------------------- /app/config/cache.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'sqlite', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => 'l4_', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'laravel-4.1-simple-blog', 59 | 'username' => 'root', 60 | 'password' => '', 61 | 'charset' => 'utf8', 62 | // 'collation' => 'utf8_unicode_ci', 63 | 'collation' => 'utf8_general_ci', 64 | 'prefix' => 'l4_', 65 | ), 66 | 67 | 'pgsql' => array( 68 | 'driver' => 'pgsql', 69 | 'host' => 'localhost', 70 | 'database' => 'database', 71 | 'username' => 'root', 72 | 'password' => '', 73 | 'charset' => 'utf8', 74 | 'prefix' => '', 75 | 'schema' => 'public', 76 | ), 77 | 78 | 'sqlsrv' => array( 79 | 'driver' => 'sqlsrv', 80 | 'host' => 'localhost', 81 | 'database' => 'database', 82 | 'username' => 'root', 83 | 'password' => '', 84 | 'prefix' => '', 85 | ), 86 | 87 | ), 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Migration Repository Table 92 | |-------------------------------------------------------------------------- 93 | | 94 | | This table keeps track of all the migrations that have already run for 95 | | your application. Using this information, we can determine which of 96 | | the migrations on disk haven't actually been run in the database. 97 | | 98 | */ 99 | 100 | 'migrations' => 'migrations', 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Redis Databases 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Redis is an open source, fast, and advanced key-value store that also 108 | | provides a richer set of commands than a typical key-value systems 109 | | such as APC or Memcached. Laravel makes it easy to dig right in. 110 | | 111 | */ 112 | 113 | 'redis' => array( 114 | 115 | 'cluster' => false, 116 | 117 | 'default' => array( 118 | 'host' => '127.0.0.1', 119 | 'port' => 6379, 120 | 'database' => 0, 121 | ), 122 | 123 | ), 124 | 125 | ); 126 | -------------------------------------------------------------------------------- /app/config/extend.php: -------------------------------------------------------------------------------- 1 | array( // 样式文件别名配置 13 | 14 | 'bootstrap-2.3.2' => 'assets/bootstrap-2.3.2/css/bootstrap.min.css', 15 | 'bootstrap-2.3.2-responsive' => 'assets/bootstrap-2.3.2/css/bootstrap-responsive.min.css', 16 | 'bootstrap-3.0.3' => 'assets/bootstrap-3.0.3/css/bootstrap.min.css', 17 | 18 | 'bootstrap-2-switch' => 'assets/bootstrap-switch/css/bootstrap2/bootstrap-switch.min.css', 19 | 'bootstrap-3-switch' => 'assets/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css', 20 | 21 | 'bootstrap-markdown' => 'assets/bootstrap-markdown/css/bootstrap-markdown.min.css', 22 | 23 | ), 24 | 25 | 'jsAliases' => array( // 脚本文件别名配置 26 | 27 | 'jquery-1.10.2' => 'assets/js/jquery-1.10.2.min.js', 28 | 'google::jquery-1.10.2' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', 29 | 'bootstrap-2.3.2' => 'assets/bootstrap-2.3.2/js/bootstrap.min.js', 30 | 'bootstrap-3.0.3' => 'assets/bootstrap-3.0.3/js/bootstrap.min.js', 31 | 32 | 'bootstrap-2-switch' => 'assets/bootstrap-switch/js/bootstrap-switch.min.js', 33 | 'bootstrap-3-switch' => 'assets/bootstrap-switch/js/bootstrap-switch.min.js', 34 | 35 | 'markdown' => 'assets/bootstrap-markdown/js/markdown.js', 36 | 'to-markdown' => 'assets/bootstrap-markdown/js/to-markdown.js', 37 | 'bootstrap-markdown' => 'assets/bootstrap-markdown/js/bootstrap-markdown.js', 38 | 39 | ), 40 | 41 | 42 | 43 | 44 | ); -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Postmark mail service, which will provide reliable delivery. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to delivery e-mails to 39 | | users of your application. Like the host we have set this value to 40 | | stay compatible with the Postmark e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ); -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/packages/barryvdh/laravel-debugbar/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/config/packages/barryvdh/laravel-debugbar/.gitkeep -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | ), 42 | 43 | 'sqs' => array( 44 | 'driver' => 'sqs', 45 | 'key' => 'your-public-key', 46 | 'secret' => 'your-secret-key', 47 | 'queue' => 'your-queue-url', 48 | 'region' => 'us-east-1', 49 | ), 50 | 51 | 'iron' => array( 52 | 'driver' => 'iron', 53 | 'project' => 'your-project-id', 54 | 'token' => 'your-token', 55 | 'queue' => 'your-queue-name', 56 | ), 57 | 58 | 'redis' => array( 59 | 'driver' => 'redis', 60 | 'queue' => 'default', 61 | ), 62 | 63 | ), 64 | 65 | /* 66 | |-------------------------------------------------------------------------- 67 | | Failed Queue Jobs 68 | |-------------------------------------------------------------------------- 69 | | 70 | | These options configure the behavior of failed queue job logging so you 71 | | can control which database and table are used to store the jobs that 72 | | have failed. You may change them to any database / table you wish. 73 | | 74 | */ 75 | 76 | 'failed' => array( 77 | 78 | 'database' => 'mysql', 'table' => 'failed_jobs', 79 | 80 | ), 81 | 82 | ); 83 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'file', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session File Location 39 | |-------------------------------------------------------------------------- 40 | | 41 | | When using the native session driver, we need a location where session 42 | | files may be stored. A default has been set for you but a different 43 | | location may be specified. This is only needed for file sessions. 44 | | 45 | */ 46 | 47 | 'files' => storage_path().'/sessions', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session Database Connection 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the "database" or "redis" session drivers, you may specify a 55 | | connection that should be used to manage these sessions. This should 56 | | correspond to a connection in your database configuration options. 57 | | 58 | */ 59 | 60 | 'connection' => null, 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Table 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" session driver, you may specify the table we 68 | | should use to manage the sessions. Of course, a sensible default is 69 | | provided for you; however, you are free to change this as needed. 70 | | 71 | */ 72 | 73 | 'table' => 'sessions', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Sweeping Lottery 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some session drivers must manually sweep their storage location to get 81 | | rid of old sessions from storage. Here are the chances that it will 82 | | happen on a given request. By default, the odds are 2 out of 100. 83 | | 84 | */ 85 | 86 | 'lottery' => array(2, 100), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cookie Name 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Here you may change the name of the cookie used to identify a session 94 | | instance by ID. The name specified here will get used every time a 95 | | new session cookie is created by the framework for every driver. 96 | | 97 | */ 98 | 99 | 'cookie' => 'laravel_session', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Path 104 | |-------------------------------------------------------------------------- 105 | | 106 | | The session cookie path determines the path for which the cookie will 107 | | be regarded as available. Typically, this will be the root path of 108 | | your application but you are free to change this when necessary. 109 | | 110 | */ 111 | 112 | 'path' => '/', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Domain 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the domain of the cookie used to identify a session 120 | | in your application. This will determine which domains the cookie is 121 | | available to in your application. A sensible default has been set. 122 | | 123 | */ 124 | 125 | 'domain' => null, 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | HTTPS Only Cookies 130 | |-------------------------------------------------------------------------- 131 | | 132 | | By setting this option to true, session cookies will only be sent back 133 | | to the server if the browser has a HTTPS connection. This will keep 134 | | the cookie from being sent to you if it can not be done securely. 135 | | 136 | */ 137 | 138 | 'secure' => false, 139 | 140 | ); 141 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/Admin/CategoryResource.php: -------------------------------------------------------------------------------- 1 | '请填写分类名称。', 41 | 'name.unique' => '已有同名分类。', 42 | 'sort_order.required' => '请填写分类排序。', 43 | 'sort_order.integer' => '请填写一个整数。', 44 | ); 45 | 46 | /** 47 | * 资源列表页面 48 | * GET /resource 49 | * @return Response 50 | */ 51 | public function index() 52 | { 53 | $datas = $this->model->orderBy('sort_order')->paginate(15); 54 | return View::make($this->resourceView.'.index')->with(compact('datas')); 55 | } 56 | 57 | /** 58 | * 资源创建动作 59 | * POST /resource 60 | * @return Response 61 | */ 62 | public function store() 63 | { 64 | // 获取所有表单数据. 65 | $data = Input::all(); 66 | // 创建验证规则 67 | $unique = $this->unique(); 68 | $rules = array( 69 | 'name' => 'required|'.$unique, 70 | 'sort_order' => 'required|integer', 71 | ); 72 | // 自定义验证消息 73 | $messages = $this->validatorMessages; 74 | // 开始验证 75 | $validator = Validator::make($data, $rules, $messages); 76 | if ($validator->passes()) { 77 | // 验证成功 78 | // 添加资源 79 | $model = $this->model; 80 | $model->name = e($data['name']); 81 | $model->sort_order = e($data['sort_order']); 82 | if ($model->save()) { 83 | // 添加成功 84 | return Redirect::back() 85 | ->with('success', ''.$this->resourceName.'添加成功:您可以继续添加新'.$this->resourceName.',或返回'.$this->resourceName.'列表。'); 86 | } else { 87 | // 添加失败 88 | return Redirect::back() 89 | ->withInput() 90 | ->with('error', ''.$this->resourceName.'添加失败。'); 91 | } 92 | } else { 93 | // 验证失败 94 | return Redirect::back()->withInput()->withErrors($validator); 95 | } 96 | } 97 | 98 | /** 99 | * 资源编辑动作 100 | * PUT/PATCH /resource/{id} 101 | * @param int $id 102 | * @return Response 103 | */ 104 | public function update($id) 105 | { 106 | // 获取所有表单数据. 107 | $data = Input::all(); 108 | // 创建验证规则 109 | $rules = array( 110 | 'name' => 'required|'.$this->unique('name', $id), 111 | 'sort_order' => 'required|integer', 112 | ); 113 | // 自定义验证消息 114 | $messages = $this->validatorMessages; 115 | // 开始验证 116 | $validator = Validator::make($data, $rules, $messages); 117 | if ($validator->passes()) { 118 | // 验证成功 119 | // 更新资源 120 | $model = $this->model->find($id); 121 | $model->name = e($data['name']); 122 | $model->sort_order = e($data['sort_order']); 123 | if ($model->save()) { 124 | // 更新成功 125 | return Redirect::back() 126 | ->with('success', ''.$this->resourceName.'更新成功:您可以继续编辑'.$this->resourceName.',或返回'.$this->resourceName.'列表。'); 127 | } else { 128 | // 更新失败 129 | return Redirect::back() 130 | ->withInput() 131 | ->with('error', ''.$this->resourceName.'更新失败。'); 132 | } 133 | } else { 134 | // 验证失败 135 | return Redirect::back()->withInput()->withErrors($validator); 136 | } 137 | } 138 | 139 | 140 | } 141 | -------------------------------------------------------------------------------- /app/controllers/AdminController.php: -------------------------------------------------------------------------------- 1 | beforeFilter('csrf', array('on' => 'post|put|delete')); 20 | // 实例化 消息对象 21 | $this->messages = new Illuminate\Support\MessageBag; 22 | } 23 | 24 | /** 25 | * 当负责响应的方法没有返回值,或返回值为 null 时, 26 | * 系统将判断 layout 属性是否为空, 27 | * 若不为空,则根据 layout 属性,返回一个视图响应。 28 | * @return void 29 | */ 30 | protected function setupLayout() 31 | { 32 | if (! is_null($this->layout)) { 33 | $this->layout = View::make($this->layout); 34 | } 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /app/controllers/BlogController.php: -------------------------------------------------------------------------------- 1 | paginate(5); 12 | $categories = Category::orderBy('sort_order')->get(); 13 | return View::make('blog.index')->with(compact('articles', 'categories')); 14 | } 15 | 16 | /** 17 | * 分类文章列表 18 | * @return Respanse 19 | */ 20 | public function getCategoryArticles($category_id) 21 | { 22 | $articles = Article::where('category_id', $category_id)->orderBy('created_at', 'desc')->paginate(5); 23 | $categories = Category::orderBy('sort_order')->get(); 24 | return View::make('blog.categoryArticles')->with(compact('articles', 'categories', 'category_id')); 25 | } 26 | 27 | /** 28 | * 博客文章展示页面 29 | * @param string $slug 文章缩略名 30 | * @return response 31 | */ 32 | public function getBlogShow($slug) 33 | { 34 | $article = Article::where('slug', $slug)->first(); 35 | is_null($article) AND App::abort(404); 36 | $categories = Category::orderBy('sort_order')->get(); 37 | return View::make('blog.show')->with(compact('article', 'categories')); 38 | } 39 | 40 | /** 41 | * 提交评论 42 | * @param string $slug 文章缩略名 43 | * @return response 44 | */ 45 | public function postBlogComment($slug) 46 | { 47 | // 获取评论内容 48 | $content = e(Input::get('content')); 49 | // 字数检查 50 | if (mb_strlen($content)<3) 51 | return Redirect::back()->withInput()->withErrors($this->messages->add('content', '评论不得少于3个字符。')); 52 | // 查找对应文章 53 | $article = Article::where('slug', $slug)->first(); 54 | // 创建文章评论 55 | $comment = new Comment; 56 | $comment->content = $content; 57 | $comment->article_id = $article->id; 58 | $comment->user_id = Auth::user()->id; 59 | if ($comment->save()) { 60 | // 创建成功 61 | // 更新评论数 62 | $article->comments_count = $article->comments->count(); 63 | $article->save(); 64 | // 返回成功信息 65 | return Redirect::back()->with('success', '评论成功。'); 66 | } else { 67 | // 创建失败 68 | return Redirect::back()->withInput()->with('error', '评论失败。'); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/database/migrations/.gitkeep -------------------------------------------------------------------------------- /app/database/migrations/2014_09_09_135540_create_authority_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 21 | $table->string('email' )->comment('邮箱'); 22 | $table->string('password' )->comment('密码'); 23 | $table->string('portrait' )->nullable()->comment('用户头像'); 24 | $table->string('remember_token' )->nullable()->comment('记住登陆状态的令牌'); 25 | $table->boolean('is_admin' )->default(false)->comment('是否管理员'); 26 | $table->timestamp('signin_at' )->nullable()->comment('最后登录时间'); 27 | $table->timestamp('activated_at')->nullable()->comment('邮箱激活时间'); 28 | 29 | $table->timestamps(); 30 | $table->softDeletes(); 31 | 32 | $table->comment = '用户表'; 33 | $table->engine = 'MyISAM'; 34 | $table->unique('email'); 35 | }); 36 | $this->seedUser(); 37 | 38 | // 账号激活 39 | Schema::create('activations', function ($table) { 40 | 41 | $table->increments('id'); 42 | $table->string('email')->comment('邮箱'); 43 | $table->string('token')->comment('令牌'); 44 | 45 | $table->timestamps(); 46 | 47 | $table->comment = '账号激活'; 48 | $table->engine = 'MyISAM'; 49 | $table->index('email'); 50 | $table->unique('token'); 51 | }); 52 | 53 | // 密码重置 54 | Schema::create('password_reminders', function ($table) { 55 | 56 | $table->string('email')->comment('邮箱'); 57 | $table->string('token')->comment('令牌'); 58 | 59 | $table->timestamps(); 60 | 61 | $table->comment = '密码重置'; 62 | $table->engine = 'MyISAM'; 63 | $table->index('email'); 64 | $table->unique('token'); 65 | }); 66 | } 67 | 68 | /** 69 | * Reverse the migrations. 70 | * 71 | * @return void 72 | */ 73 | public function down() 74 | { 75 | Schema::drop('users'); 76 | Schema::drop('activations'); 77 | Schema::drop('password_reminders'); 78 | } 79 | 80 | /** 81 | * 填充 users 表基础数据 82 | * @return void 83 | */ 84 | private function seedUser() 85 | { 86 | User::create(array( 87 | 'email' => 'admin@demo.com', 88 | 'password' => '111111', 89 | 'is_admin' => 1, 90 | 'activated_at' => Carbon::now(), 91 | )); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_09_141726_create_blog_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 21 | $table->string('name' )->comment('分类名称'); 22 | $table->integer('sort_order')->unsigned()->default(0)->comment('排序'); 23 | 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | 27 | $table->comment = '文章分类'; 28 | $table->engine = 'MyISAM'; 29 | $table->unique('name'); 30 | }); 31 | $this->seedArticleCategory(); 32 | 33 | // 文章 34 | Schema::create('articles', function ($table) { 35 | 36 | $table->increments('id'); 37 | $table->integer('user_id' )->unsigned()->comment('作者ID'); 38 | $table->integer('category_id' )->unsigned()->comment('文章分类ID'); 39 | $table->integer('comments_count' )->unsigned()->default(0)->comment('评论数'); 40 | 41 | $table->string('title' )->comment('标题'); 42 | $table->string('slug' )->comment('文章缩略名'); 43 | $table->text('content' )->comment('内容'); 44 | $table->string('content_format' )->default('markdown')->comment('内容格式,为后期加入非 markdown 编辑器做准备'); 45 | 46 | $table->string('meta_title' )->nullable()->comment('SEO 页面标题'); 47 | $table->string('meta_description')->nullable()->comment('SEO 页面描述'); 48 | $table->string('meta_keywords' )->nullable()->comment('SEO 页面关键词'); 49 | 50 | $table->timestamps(); 51 | $table->softDeletes(); 52 | 53 | $table->comment = '文章'; 54 | $table->engine = 'MyISAM'; 55 | $table->index('user_id'); 56 | $table->index('category_id'); 57 | $table->unique('title'); 58 | $table->unique('slug'); 59 | }); 60 | 61 | // 文章的评论 62 | Schema::create('article_comments', function ($table) { 63 | 64 | $table->increments('id'); 65 | $table->integer('user_id' )->unsigned()->comment('作者ID'); 66 | $table->integer('article_id')->unsigned()->comment('归属文章ID'); 67 | $table->text('content' )->comment('内容'); 68 | 69 | $table->timestamps(); 70 | $table->softDeletes(); 71 | 72 | $table->comment = '文章的评论'; 73 | $table->engine = 'MyISAM'; 74 | $table->index('user_id'); 75 | $table->index('article_id'); 76 | }); 77 | } 78 | 79 | /** 80 | * Reverse the migrations. 81 | * 82 | * @return void 83 | */ 84 | public function down() 85 | { 86 | Schema::drop('article_categories'); 87 | Schema::drop('articles'); 88 | Schema::drop('article_comments'); 89 | } 90 | 91 | /** 92 | * 填充 article_categories 表基础数据 93 | * @return void 94 | */ 95 | private function seedArticleCategory() 96 | { 97 | Category::create(array( 98 | 'name' => '默认分类', 99 | )); 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/database/production.sqlite -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/database/seeds/.gitkeep -------------------------------------------------------------------------------- /app/database/seeds/AuthorityTablesSeeder.php: -------------------------------------------------------------------------------- 1 | 'a'.$i.'@a.com', 18 | 'password' => $password, 19 | 'activated_at' => $now, 20 | )); 21 | } 22 | 23 | $this->command->info('测试用户数据填充完毕'); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /app/database/seeds/BlogTablesSeeder.php: -------------------------------------------------------------------------------- 1 | seedCategory(); 13 | $this->seedArticle(); 14 | $this->seedComment(); 15 | } 16 | 17 | /** 18 | * 填充分类数据 19 | * @return void 20 | */ 21 | private function seedCategory() 22 | { 23 | foreach (array('PHP-PSR 代码标准', '新分类二', '新分类三', '新分类四', '新分类五') as $key => $value) { 24 | Category::create(array( 25 | 'name' => $value, 26 | 'sort_order' => $key+1, 27 | )); 28 | } 29 | $this->command->info('测试分类数据填充完毕'); 30 | } 31 | 32 | /** 33 | * 填充文章数据 34 | * @return void 35 | */ 36 | private function seedArticle() 37 | { 38 | for ($i = 1; $i < 30; $i++) { 39 | Article::create(array( 40 | 'category_id' => 2+$i%4, 41 | 'user_id' => $i, 42 | 'title' => '标题'.$i, 43 | 'slug' => 'slug-biao-ti-'.$i, 44 | 'content' => $this->generateArticleContent($i), 45 | )); 46 | } 47 | $this->command->info('随机文章数据填充完毕'); 48 | sleep(1); 49 | 50 | Article::create(array( 51 | 'category_id' => 2, 52 | 'user_id' => 1, 53 | 'title' => 'PSR-0 自动加载规范', 54 | 'slug' => 'psr-0', 55 | 'content' => File::get(__DIR__.'/PSR/PSR-0.md'), 56 | )); 57 | sleep(1); 58 | Article::create(array( 59 | 'category_id' => 2, 60 | 'user_id' => 1, 61 | 'title' => 'PSR-1 基础编码规范', 62 | 'slug' => 'psr-1-basic-coding-standard', 63 | 'content' => File::get(__DIR__.'/PSR/PSR-1-basic-coding-standard.md'), 64 | )); 65 | sleep(1); 66 | Article::create(array( 67 | 'category_id' => 2, 68 | 'user_id' => 1, 69 | 'title' => 'PSR-2 编码风格规范', 70 | 'slug' => 'psr-2-coding-style-guide', 71 | 'content' => File::get(__DIR__.'/PSR/PSR-2-coding-style-guide.md'), 72 | )); 73 | sleep(1); 74 | Article::create(array( 75 | 'category_id' => 2, 76 | 'user_id' => 1, 77 | 'title' => 'PSR-3 日志接口规范', 78 | 'slug' => 'psr-3-logger-interface', 79 | 'content' => File::get(__DIR__.'/PSR/PSR-3-logger-interface.md'), 80 | )); 81 | 82 | $this->command->info('PSR 系列文章数据填充完毕'); 83 | } 84 | 85 | /** 86 | * 填充评论数据 87 | * @return void 88 | */ 89 | private function seedComment() 90 | { 91 | Comment::truncate(); // 清空表 92 | 93 | for ($i = 1; $i < 30; $i++) { 94 | Comment::create(array( 95 | 'user_id' => $i, 96 | 'article_id' => 1 + $i%5 + 28, 97 | 'content' => '评论内容'.$i, 98 | )); 99 | Article::find(1 + $i%5 + 28)->increment('comments_count'); 100 | } 101 | 102 | $this->command->info('随机评论数据填充完毕'); 103 | } 104 | 105 | /** 106 | * 生成文章内容 107 | * @param integer $i 递增数 108 | * @return string 109 | */ 110 | private function generateArticleContent($i) 111 | { 112 | return $i.'、什么是依赖 113 | 每个项目都有依赖(外界提供的输入), 项目越复杂,越需要更多的依赖。在现今的网络应用程序中,最常见的依赖是数据库,其风险在于,一旦数据库暂停运行,那么整个程序也因此而停止运行。这是因为代码依赖数据库服务器……这已足够。因为数据库服务器有时会崩溃,而弃用它是荒谬的。尽管依赖有其自身的瑕疵,却仍然存在代码中,因为它使程序开发人员的工作更加轻松。'; 114 | } 115 | 116 | } -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('AuthorityTablesSeeder'); 15 | $this->call('BlogTablesSeeder'); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /app/database/seeds/PSR/PSR-0.md: -------------------------------------------------------------------------------- 1 | 下面描述了关于自动加载器特性强制性要求: 2 | 3 | 强制性 4 | --------- 5 | 6 | * 一个完全标准的命名空间必须要有以下的格式结构`\\(\)*` 7 | * 命名空间必须有一个顶级的组织名称 ("Vendor Name"). 8 | * 命名空间中可以根据情况使用任意数量的子空间 9 | * 从文件系统中加载源文件的时,命名空间中的分隔符将被映射为 `DIRECTORY_SEPARATOR` 10 | * 命名空间中的类名中的`_`没有特殊含义,也将被作为`DIRECTORY_SEPARATOR`对待. 11 | * 标准的命名空间和类从文件系统加载源文件时只需要加上`.php`后缀即可 12 | * 组织名,空间名,类名都可以随意使用大小写英文字符的组合 13 | 14 | 示例 15 | -------- 16 | 17 | * `\Doctrine\Common\IsolatedClassLoader` => `/path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php` 18 | * `\Symfony\Core\Request` => `/path/to/project/lib/vendor/Symfony/Core/Request.php` 19 | * `\Zend\Acl` => `/path/to/project/lib/vendor/Zend/Acl.php` 20 | * `\Zend\Mail\Message` => `/path/to/project/lib/vendor/Zend/Mail/Message.php` 21 | 22 | 命名空间和类名中的下划线 23 | ----------------------------------------- 24 | 25 | * `\namespace\package\Class_Name` => `/path/to/project/lib/vendor/namespace/package/Class/Name.php` 26 | * `\namespace\package_name\Class_Name` => `/path/to/project/lib/vendor/namespace/package_name/Class/Name.php` 27 | 28 | 以上是我们为轻松实现自动加载特性设定的最低标准。你可以利用下面这个可以自动加载 PHP 5.3 类的SplClassLoader来测试你的代码是否符合以上这些标准。 29 | 30 | 实例 31 | ---------------------- 32 | 33 | 下面是一个函数实例简单展示如何使用上面建议的标准进行自动加载 34 | ```php 35 | `或者短输出式``标签;它`不可`使用其他的标签变种。 36 | 37 | ### 2.2. 字符编码 38 | 39 | PHP代码`必须`只使用不带BOM的UTF-8。 40 | 41 | ### 2.3. 副作用 42 | 43 | 一个文件`应当`声明新符号 (类名,函数名,常量等)并且不产生副作用,或者`应当`执行有副作用的逻辑,但不能同时做这两件事。 44 | 45 | 短语"副作用"意思是不直接执行逻辑的类,函数,常量等 *仅包括文件* 46 | 47 | “副作用”包含但不局限于:生成输出,显式地使用`require`或`include`,连接外部服务,修改ini配置,触发错误或异常,修改全局或者静态变量,读取或修改文件等等 48 | 49 | 下面是一个既包含声明又有副作用的示例文件;即应避免的例子: 50 | 51 | ```php 52 | \n"; 61 | 62 | // declaration 63 | function foo() 64 | { 65 | // function body 66 | } 67 | ``` 68 | 69 | 下面是一个仅包含声明的示例文件;即需要提倡的例子: 70 | 71 | ```php 72 | is_admin) return Redirect::back(); 52 | }); 53 | 54 | # 必须是登录用户 55 | Route::filter('auth', function () { 56 | // 拦截未登录用户并记录当前 URL,跳转到登录页面 57 | if (Auth::guest()) return Redirect::guest(route('signin')); 58 | }); 59 | 60 | # HTTP 基础身份验证过滤器 - 单次弹窗登录验证 61 | Route::filter('auth.basic', function () { 62 | return Auth::basic(); 63 | }); 64 | 65 | # 必须是游客(较少应用) 66 | Route::filter('guest', function () { 67 | // 拦截已登录用户 68 | if (Auth::check()) return Redirect::to('/'); 69 | }); 70 | 71 | # 禁止对自己的账号进行危险操作 72 | Route::filter('not.self', function ($route) { 73 | // 拦截自身用户 ID 74 | if (Auth::user()->id == $route->parameter('id')) 75 | return Redirect::back(); 76 | }); 77 | 78 | 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | [后置] 过滤器 83 | |-------------------------------------------------------------------------- 84 | # Route::filter('afterFilter', function ($route, $request, $response) {}); 85 | | 86 | */ 87 | 88 | 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | 事件监控 93 | |-------------------------------------------------------------------------- 94 | | 95 | */ 96 | # 用户登录事件 97 | Event::listen('auth.login', function ($user, $remember) { 98 | // 记录最后登录时间 99 | $user->signin_at = new Carbon; 100 | $user->save(); 101 | // 后期可附加权限相关操作 102 | // ... 103 | }); 104 | # 用户退出事件 105 | // Event::listen('auth.logout', function ($user) { 106 | // // 107 | // }); 108 | -------------------------------------------------------------------------------- /app/lang/en/friendlyDate.php: -------------------------------------------------------------------------------- 1 | ' before', 13 | 'after' => ' after', 14 | 15 | 'second' => ' second', 16 | 'seconds' => ' seconds', 17 | 18 | 'minute' => ' minute', 19 | 'minutes' => ' minutes', 20 | 21 | 'hour' => ' hour', 22 | 'hours' => ' hours', 23 | 24 | 'day' => ' day', 25 | 'days' => ' days', 26 | 27 | 'week' => ' week', 28 | 'weeks' => ' weeks', 29 | 30 | 'month' => ' month', 31 | 'months' => ' months', 32 | 33 | 'year' => ' year', 34 | 'years' => ' years', 35 | 36 | ); 37 | -------------------------------------------------------------------------------- /app/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/lang/zh-CN/friendlyDate.php: -------------------------------------------------------------------------------- 1 | '前', 13 | 'after' => '后', 14 | 15 | 'second' => '秒钟', 16 | 'seconds' => '秒钟', 17 | 18 | 'minute' => '分钟', 19 | 'minutes' => '分钟', 20 | 21 | 'hour' => '小时', 22 | 'hours' => '小时', 23 | 24 | 'day' => '天', 25 | 'days' => '天', 26 | 27 | 'week' => '周', 28 | 'weeks' => '周', 29 | 30 | 'month' => '个月', 31 | 'months' => '个月', 32 | 33 | 'year' => '年', 34 | 'years' => '年', 35 | 36 | ); 37 | -------------------------------------------------------------------------------- /app/lang/zh-CN/pagination.php: -------------------------------------------------------------------------------- 1 | '« 往前', 17 | 18 | 'next' => '往后 »', 19 | ); 20 | -------------------------------------------------------------------------------- /app/lang/zh-CN/reminders.php: -------------------------------------------------------------------------------- 1 | "密码必须符合指定格式。", 17 | 18 | "user" => "找不到该邮箱对应的用户。", 19 | 20 | "token" => "密码重置令牌无效。", 21 | 22 | "sent" => "密码重置邮件已发送!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/lang/zh-CN/validation.php: -------------------------------------------------------------------------------- 1 | ":attribute 必须接受。", 17 | "active_url" => ":attribute 不是一个有效的URL。", 18 | "after" => ":attribute 必须是一个在 :date 之后的日期。", 19 | "alpha" => ":attribute 只能由字母组成。", 20 | "alpha_dash" => ":attribute 只能由字母、数字、中划线、下划线组成。", 21 | "alpha_num" => ":attribute 只能由字母和数字组成。", 22 | "array" => ":attribute 必须是一个数组。", 23 | "before" => ":attribute 必须是一个在 :date 之前的日期。", 24 | "between" => array( 25 | "numeric" => ":attribute 必须介于 :min - :max 之间。", 26 | "file" => ":attribute 必须介于 :min - :max 千字节之间。", 27 | "string" => ":attribute 必须介于 :min - :max 个字符之间。", 28 | "array" => ":attribute 必须介于 :min - :max 个单元之间。" 29 | ), 30 | "confirmed" => ":attribute 确认不匹配。", 31 | "date" => ":attribute 不是一个有效的日期。", 32 | "date_format" => ":attribute 不匹配日期格式 :format。", 33 | "different" => ":attribute 和 :other 必须不同。", 34 | "digits" => ":attribute 必须是 :digits 位的数字。", 35 | "digits_between" => ":attribute 必须是介于 :min 和 :max 位的数字。", 36 | "email" => ":attribute 电邮格式非法。", 37 | "exists" => "已选的属性 :attribute 非法。", 38 | "image" => ":attribute 必须是一张图片。", 39 | "in" => "已选的属性 :attribute 非法。", 40 | "integer" => ":attribute 必须是一个整数。", 41 | "ip" => ":attribute 必须是一个有效的IP地址。", 42 | "max" => array( 43 | "numeric" => ":attribute 必须小于 :max 。", 44 | "file" => ":attribute 必须小于 :max 千字节。", 45 | "string" => ":attribute 必须小于 :max 个字符。", 46 | "array" => ":attribute 必须小于 :max 个单元。" 47 | ), 48 | "mimes" => ":attribute 必须是一个 :values 类型的文件。", 49 | "min" => array( 50 | "numeric" => ":attribute 必须大于 :min 。", 51 | "file" => ":attribute 必须大于 :min 千字节。", 52 | "string" => ":attribute 必须大于 :min 个字符。", 53 | "array" => ":attribute 必须大于 :min 个单元。" 54 | ), 55 | "not_in" => "已选的属性 :attribute 非法。", 56 | "numeric" => ":attribute 必须是一个数字。", 57 | "regex" => ":attribute 字段必填。", 58 | "required" => ":attribute 属性需要填写字段。", 59 | "required_if" => ":attribute 属性当 :other 为 :value时为必填项。", 60 | "required_with" => ":attribute 属性当 :values 存在时为必填项。", 61 | "required_without" => ":attribute 属性当 :values 不存在时为必填项。", 62 | "same" => ":attribute 和 :other 必须匹配。", 63 | "size" => array( 64 | "numeric" => ":attribute 大小必须是 :size 。", 65 | "file" => ":attribute 大小必须是 :size 千字节。", 66 | "string" => ":attribute 必须是 :size 个字符。", 67 | "array" => ":attribute 必须包含 :size 个单元。" 68 | ), 69 | "unique" => ":attribute 已经有人使用。", 70 | "url" => ":attribute 格式非法。", 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Custom Validation Language Lines 75 | |-------------------------------------------------------------------------- 76 | | 77 | | Here you may specify custom validation messages for attributes using the 78 | | convention "attribute.rule" to name the lines. This makes it quick to 79 | | specify a specific custom language line for a given attribute rule. 80 | | 81 | */ 82 | 83 | 'custom' => array(), 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Custom Validation Attributes 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The following language lines are used to swap attribute place-holders 91 | | with something more reader friendly such as E-Mail Address instead 92 | | of "email". This simply helps us make messages a little cleaner. 93 | | 94 | */ 95 | 96 | 'attributes' => array(), 97 | 98 | ); 99 | -------------------------------------------------------------------------------- /app/models/Activation.php: -------------------------------------------------------------------------------- 1 | belongsTo('Category', 'category_id'); 29 | } 30 | 31 | /** 32 | * 文章的作者 33 | * 一对多逆向 34 | * @return object User 35 | */ 36 | public function user() 37 | { 38 | return $this->belongsTo('User', 'user_id'); 39 | } 40 | 41 | /** 42 | * 文章的评论 43 | * 一对多 44 | * @return object Illuminate\Database\Eloquent\Collection 45 | */ 46 | public function comments() 47 | { 48 | return $this->hasMany('Comment', 'article_id'); 49 | } 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | 访问器 54 | |-------------------------------------------------------------------------- 55 | */ 56 | /** 57 | * 文章内容(原始) 58 | * @return string 59 | */ 60 | public function getContentAttribute($value) 61 | { 62 | return strip($value); 63 | } 64 | 65 | /** 66 | * 文章内容(HTML 格式) 67 | * @return string 68 | */ 69 | public function getContentHtmlAttribute() 70 | { 71 | switch ($this->content_format) { 72 | case 'markdown': 73 | return MarkdownExtra::defaultTransform($this->content); 74 | case 'html': 75 | return $this->content; 76 | } 77 | } 78 | 79 | /** 80 | * 文章内容(Markdown 格式) 81 | * @return string 82 | */ 83 | public function getContentMarkdownAttribute() 84 | { 85 | switch ($this->content_format) { 86 | case 'markdown': 87 | return $this->content; 88 | case 'html': 89 | return new HTML_To_Markdown($this->content); 90 | } 91 | } 92 | 93 | 94 | } -------------------------------------------------------------------------------- /app/models/BaseModel.php: -------------------------------------------------------------------------------- 1 | created_at); 47 | } 48 | 49 | /** 50 | * 友好的更新时间 51 | * @return string 52 | */ 53 | public function getFriendlyUpdatedAtAttribute() 54 | { 55 | return friendly_date($this->updated_at); 56 | } 57 | 58 | /** 59 | * 友好的删除时间 60 | * @return string 61 | */ 62 | public function getFriendlyDeletedAtAttribute() 63 | { 64 | return friendly_date($this->deleted_at); 65 | } 66 | 67 | 68 | } -------------------------------------------------------------------------------- /app/models/Category.php: -------------------------------------------------------------------------------- 1 | hasMany('Article', 'category_id'); 32 | } 33 | 34 | 35 | 36 | } -------------------------------------------------------------------------------- /app/models/Comment.php: -------------------------------------------------------------------------------- 1 | belongsTo('Article', 'article_id'); 32 | } 33 | 34 | /** 35 | * 评论的作者 36 | * 一对一逆向 37 | * @return object User 38 | */ 39 | public function user() 40 | { 41 | return $this->belongsTo('User', 'user_id'); 42 | } 43 | 44 | 45 | } -------------------------------------------------------------------------------- /app/models/PassowrdReminder.php: -------------------------------------------------------------------------------- 1 | getKey(); 34 | } 35 | 36 | /** 37 | * Get the password for the user. 38 | * 39 | * @return string 40 | */ 41 | public function getAuthPassword() 42 | { 43 | return $this->password; 44 | } 45 | 46 | /** 47 | * Get the token value for the "remember me" session. 48 | * 49 | * @return string 50 | */ 51 | public function getRememberToken() 52 | { 53 | return $this->remember_token; 54 | } 55 | 56 | /** 57 | * Set the token value for the "remember me" session. 58 | * 59 | * @param string $value 60 | * @return void 61 | */ 62 | public function setRememberToken($value) 63 | { 64 | $this->remember_token = $value; 65 | } 66 | 67 | /** 68 | * Get the column name for the "remember me" token. 69 | * 70 | * @return string 71 | */ 72 | public function getRememberTokenName() 73 | { 74 | return 'remember_token'; 75 | } 76 | 77 | /** 78 | * Get the e-mail address where password reminders are sent. 79 | * 80 | * @return string 81 | */ 82 | public function getReminderEmail() 83 | { 84 | return $this->email; 85 | } 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | 访问器 90 | |-------------------------------------------------------------------------- 91 | */ 92 | /** 93 | * 友好的最后登录时间 94 | * @return string 95 | */ 96 | public function getFriendlySigninAtAttribute() 97 | { 98 | if (is_null($this->signin_at)) 99 | return '新账号尚未登录'; 100 | else 101 | return friendly_date($this->signin_at); 102 | } 103 | 104 | /** 105 | * 用户头像(大) 106 | * @return string 用户头像的 URI 107 | */ 108 | public function getPortraitLargeAttribute() 109 | { 110 | if ($this->portrait) 111 | return asset('portrait/large/'.$this->portrait); 112 | else 113 | return with(new Identicon)->getImageDataUri($this->email, 220); 114 | } 115 | 116 | /** 117 | * 用户头像(中) 118 | * @return string 用户头像的 URI 119 | */ 120 | public function getPortraitMediumAttribute() 121 | { 122 | if ($this->portrait) 123 | return asset('portrait/medium/'.$this->portrait); 124 | else 125 | return with(new Identicon)->getImageDataUri($this->email, 128); 126 | } 127 | 128 | /** 129 | * 用户头像(小) 130 | * @return string 用户头像的 URI 131 | */ 132 | public function getPortraitSmallAttribute() 133 | { 134 | if ($this->portrait) 135 | return asset('portrait/small/'.$this->portrait); 136 | else 137 | return with(new Identicon)->getImageDataUri($this->email, 64); 138 | } 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | 调整器 143 | |-------------------------------------------------------------------------- 144 | */ 145 | /** 146 | * 密码 147 | * @param string $value 未处理的密码字符串 148 | * @return void 149 | */ 150 | public function setPasswordAttribute($value) 151 | { 152 | // 若传入的字符串已经进行了 Hash 加密,则不重复处理 153 | $this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value; 154 | } 155 | 156 | 157 | } 158 | -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 'changePassword')) 2 | 3 | @section('title') @parent 修改密码 @stop 4 | 5 | @section('style') 6 | @parent 7 | .form 8 | { 9 | width: 330px; 10 | margin: 0 auto; 11 | padding-bottom: 2em; 12 | } 13 | .form input, .form button 14 | { 15 | margin-top: 10px; 16 | } 17 | .form strong.error{ 18 | color: #b94a48; 19 | } 20 | @stop 21 | 22 | @section('container') 23 | 24 | @include('w.notification') 25 |
26 | 27 | 28 | 29 | 30 |

修改您的密码

31 | 32 | {{ $errors->first('password_old', ':message') }} 33 |
34 | 35 | 36 | 37 | 38 |
39 | {{ $errors->first('password', ':message') }} 40 | 41 | 42 |
43 | 44 | @stop 45 | 46 | 47 | @section('end') 48 | @parent 49 | 52 | @stop 53 | -------------------------------------------------------------------------------- /app/views/account/changePortrait.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.account', array('active' => 'changePortrait')) 2 | 3 | @section('title') @parent 修改密码 @stop 4 | 5 | @section('style') 6 | @parent 7 | .form 8 | { 9 | width: 530px; 10 | margin: 0 auto; 11 | padding-bottom: 2em; 12 | } 13 | .form input, .form button 14 | { 15 | margin-top: 10px; 16 | } 17 | .form strong.error{ 18 | color: #b94a48; 19 | } 20 | @stop 21 | 22 | @section('container') 23 | 24 | {{ Form::open(array('method' => 'PUT', 'files' => true, 'class' => 'form')) }} 25 |

更改您的头像

26 | 头像(大) 27 | 头像(中) 28 | 头像(小) 29 | {{ Form::file('portrait') }} 30 | @include('w.notification') 31 | 32 | {{ Form::close() }} 33 | 34 | @stop 35 | -------------------------------------------------------------------------------- /app/views/account/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.account', array('active' => 'account')) 2 | 3 | @section('container') 4 | 5 |
6 |

用户中心首页

7 |

这里是博客系统的管理员后台,负责整个博客系统的资源管理。

8 | @if(method_exists('AuthorityController', 'test')) {{ App::make('AuthorityController')->test() }} @endif 9 |
10 | 11 | @stop 12 | -------------------------------------------------------------------------------- /app/views/account/myComments.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.account', array('active' => 'myComments')) 2 | 3 | @section('container') 4 | 5 | @include('w.notification') 6 | 7 |

我评论过的文章

8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @foreach ($comments as $comment) 20 | 21 | 28 | 29 | 33 | 34 | @endforeach 35 | 36 |
文章标题评论内容操作
22 | @if($comment->article) 23 | {{ $comment->article->title }} 24 | @else 25 | 此文章已被删除 26 | @endif 27 | {{ $comment->content }} 30 | 删除评论 32 |
37 |
38 | 39 |
40 | {{ pagination($comments, 'p.slider-3') }} 41 |
42 | 43 | 'myModal', 46 | 'title' => '系统提示', 47 | 'message' => '确认删除此评论?', 48 | 'footer' => 49 | Form::open(array('id' => 'real-delete', 'method' => 'delete')).' 50 | 51 | '. 52 | Form::close(), 53 | ); 54 | ?> 55 | @include('w.modal', $modalData) 56 | 57 | 58 | @stop 59 | 60 | @section('end') 61 | @parent 62 | 69 | @stop 70 | -------------------------------------------------------------------------------- /app/views/admin/article/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent 添加新{{ $resourceName }} @stop 4 | 5 | @section('beforeStyle') 6 | @parent 7 | {{ style('bootstrap-markdown') }} 8 | @stop 9 | 10 | @section('style') 11 | .nav-tabs>li.active>a 12 | { 13 | background-color: #f8f8f8 !important; 14 | } 15 | @parent @stop 16 | 17 | @section('container') 18 | 19 | @include('w.notification') 20 |

21 | 添加新{{ $resourceName }} 22 | 27 |

28 | 29 | 33 | 34 |
36 | 37 | 38 | 39 | 40 |
41 | 42 | 43 |
44 | 45 |
46 | 47 | {{ $errors->first('category', ':message') }} 48 | {{ Form::select('category', $categoryLists, 1, array('class' => 'form-control')) }} 49 |
50 | 51 |
52 | 53 | {{ $errors->first('title', ':message') }} 54 | 55 |
56 | 57 |
58 | 59 | {{ $errors->first('slug', ':message') }} 60 |
61 | 62 | {{ str_finish(URL::to('/'), '/') }} 63 | 64 | 65 |
66 |
67 | 68 |
69 | 70 | {{ $errors->first('content', ':message') }} 71 | 73 |
74 | 75 |
76 | 77 | 78 |
79 | 80 |
81 | 82 | 83 |
84 | 85 |
86 | 87 | 88 |
89 | 90 |
91 | 92 | 93 |
94 | 95 |
96 | 97 |
98 | 99 | 100 |
101 |
102 | 103 | 104 |
105 |
106 |
107 | 108 | @stop 109 | 110 | @section('end') 111 | @parent 112 | {{ script('markdown', 'bootstrap-markdown') }} 113 | @stop 114 | -------------------------------------------------------------------------------- /app/views/admin/article/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent {{ $resourceName }}管理 @stop 4 | 5 | @section('container') 6 | 7 | @include('w.notification') 8 | 9 |

10 | {{ $resourceName }}管理 11 | 16 |

17 | 18 | {{ Form::open(array('method' => 'get')) }} 19 |
20 | 21 | {{ 22 | Form::select( 23 | 'target', 24 | array('title' => '标题'), 25 | Input::get('target', 'title'), 26 | array('class' => 'form-control input-sm') 27 | ) 28 | }} 29 | 30 | 31 | 32 | 33 | 34 |
35 | {{ Form::close() }} 36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @foreach ($datas as $data) 49 | 50 | 56 | 57 | 58 | 63 | 64 | @endforeach 65 | 66 |
标题 {{ order_by('title') }}评论数 {{ order_by('comments_count') }}创建时间 {{ order_by('created_at', 'desc') }}操作
51 | 52 | 53 | 54 | {{ $data->title }} 55 | {{ $data->comments_count }}{{ $data->created_at }}({{ $data->friendly_created_at }}) 59 | 编辑 60 | 删除 62 |
67 |
68 | 69 |
70 | {{ pagination($datas->appends(Input::except('page')), 'p.slider-3') }} 71 |
72 | 73 | 'myModal', 76 | 'title' => '系统提示', 77 | 'message' => '确认删除此'.$resourceName.'?', 78 | 'footer' => 79 | Form::open(array('id' => 'real-delete', 'method' => 'delete')).' 80 | 81 | '. 82 | Form::close(), 83 | ); 84 | ?> 85 | @include('w.modal', $modalData) 86 | 87 | @stop 88 | 89 | @section('end') 90 | @parent 91 | 98 | @stop 99 | -------------------------------------------------------------------------------- /app/views/admin/category/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent 添加新{{ $resourceName }} @stop 4 | 5 | @section('style') 6 | .nav-tabs>li.active>a 7 | { 8 | background-color: #f8f8f8 !important; 9 | } 10 | @parent @stop 11 | 12 | @section('container') 13 | 14 | @include('w.notification') 15 |

16 | 添加新{{ $resourceName }} 17 | 22 |

23 | 24 | 27 | 28 |
30 | 31 | 32 | 33 | 34 |
35 | 36 | 37 |
38 | 39 |
40 | 41 | {{ $errors->first('name', ':message') }} 42 | 43 |
44 | 45 |
46 | 47 | {{ $errors->first('sort_order', ':message') }} 48 | 49 |
50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 |
58 | 59 | 60 |
61 |
62 |
63 | 64 | @stop 65 | -------------------------------------------------------------------------------- /app/views/admin/category/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent 编辑{{ $resourceName }} @stop 4 | 5 | @section('style') 6 | .nav-tabs>li.active>a 7 | { 8 | background-color: #f8f8f8 !important; 9 | } 10 | @parent @stop 11 | 12 | @section('container') 13 | 14 | @include('w.notification') 15 |

16 | 编辑{{ $resourceName }} 17 | 22 |

23 | 24 | 27 | 28 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 | 38 |
39 | 40 |
41 | 42 | {{ $errors->first('name', ':message') }} 43 | 44 |
45 | 46 |
47 | 48 | {{ $errors->first('sort_order', ':message') }} 49 | 50 |
51 | 52 |
53 | 54 |
55 | 56 | 57 |
58 |
59 | 重 置 60 | 61 |
62 |
63 |
64 | 65 | @stop 66 | -------------------------------------------------------------------------------- /app/views/admin/category/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent {{ $resourceName }}管理 @stop 4 | 5 | @section('container') 6 | 7 | @include('w.notification') 8 | 9 |

10 | {{ $resourceName }}管理 11 | 16 |

17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @foreach ($datas as $data) 30 | 31 | 32 | 33 | 34 | 39 | 40 | @endforeach 41 | 42 |
排序名称创建时间操作
{{ $data->sort_order }}{{ $data->name }}{{ $data->created_at }}({{ $data->friendly_created_at }}) 35 | 编辑 36 | 删除 38 |
43 |
44 | 45 |
46 | {{ pagination($datas, 'p.slider-3') }} 47 |
48 | 49 | 'myModal', 52 | 'title' => '系统提示', 53 | 'message' => '确认删除此'.$resourceName.'?', 54 | 'footer' => 55 | Form::open(array('id' => 'real-delete', 'method' => 'delete')).' 56 | 57 | '. 58 | Form::close(), 59 | ); 60 | ?> 61 | @include('w.modal', $modalData) 62 | 63 | @stop 64 | 65 | @section('end') 66 | @parent 67 | 74 | @stop 75 | -------------------------------------------------------------------------------- /app/views/admin/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => 'admin')) 2 | 3 | @section('container') 4 | 5 |
6 |

后台首页

7 |

这里是博客系统的管理员后台,负责整个博客系统的资源管理。

8 |
9 | 10 | @stop 11 | -------------------------------------------------------------------------------- /app/views/admin/user/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent 添加新{{ $resourceName }} @stop 4 | 5 | @section('beforeStyle') 6 | @parent 7 | {{ style('bootstrap-3-switch') }} 8 | @stop 9 | 10 | @section('style') 11 | .nav-tabs>li.active>a 12 | { 13 | background-color: #f8f8f8 !important; 14 | } 15 | @parent @stop 16 | 17 | @section('container') 18 | 19 | @include('w.notification') 20 |

21 | 添加新{{ $resourceName }} 22 | 27 |

28 | 29 | 33 | 34 |
36 | 37 | 38 | 39 | 40 |
41 | 42 | 43 |
44 | 45 |
46 | 47 | {{ $errors->first('email', ':message') }} 48 | 49 |
50 | 51 |
52 | 53 | {{ $errors->first('password', ':message') }} 54 | 55 |
56 | 57 |
58 | 59 | 60 |
61 | 62 |
63 | 64 | 65 |
66 | 67 |
68 | 69 | {{ $errors->first('is_admin', ':message') }} 70 |
71 | 75 |
76 |
77 | 78 |
79 | 80 |
81 | 82 | 83 |
84 |
85 | 86 | 87 |
88 |
89 |
90 | 91 | @stop 92 | 93 | @section('end') 94 | @parent 95 | {{ script('bootstrap-3-switch') }} 96 | 99 | @stop 100 | -------------------------------------------------------------------------------- /app/views/admin/user/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent 编辑{{ $resourceName }} @stop 4 | 5 | @section('beforeStyle') 6 | @parent 7 | {{ style('bootstrap-3-switch') }} 8 | @stop 9 | 10 | @section('style') 11 | .nav-tabs>li.active>a 12 | { 13 | background-color: #f8f8f8 !important; 14 | } 15 | @parent @stop 16 | 17 | @section('container') 18 | 19 | @include('w.notification') 20 |

21 | 编辑{{ $resourceName }} 22 | 27 |

28 | 29 | 33 | 34 |
36 | 37 | 38 | 39 | 40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 | 48 | {{ $errors->first('email', ':message') }} 49 | 50 |
51 | 52 |
53 | 54 | {{ $errors->first('password', ':message') }} 55 | 56 |
57 | 58 |
59 | 60 | 61 |
62 | 63 |
64 | 65 | 66 |
67 | 68 |
69 | 70 | {{ $errors->first('is_admin', ':message') }} 71 |
72 | is_admin) ? 'checked': ''; }} 74 | data-on="danger" data-off="default" data-text-label="    " 75 | data-on-label="管理员" data-off-label="普通用户"> 76 |
77 |
78 | 79 |
80 | 81 |
82 | 83 | 84 |
85 |
86 | 重 置 87 | 88 |
89 |
90 |
91 | 92 | @stop 93 | 94 | @section('end') 95 | @parent 96 | {{ script('bootstrap-3-switch') }} 97 | 100 | @stop 101 | -------------------------------------------------------------------------------- /app/views/admin/user/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.admin', array('active' => $resource)) 2 | 3 | @section('title') @parent {{ $resourceName }}管理 @stop 4 | 5 | @section('container') 6 | 7 | @include('w.notification') 8 | 9 |

10 | {{ $resourceName }}管理 11 | 16 |

17 | 18 | {{ Form::open(array('method' => 'get')) }} 19 |
20 | 21 | {{ 22 | Form::select( 23 | 'status', 24 | array('all' => '所有', '1' => '管理员', '0' => '普通用户'), 25 | Input::get('status', 'all'), 26 | array('class' => 'form-control input-sm') 27 | ) 28 | }} 29 | 30 | 31 | {{ 32 | Form::select( 33 | 'target', 34 | array('email' => '邮箱'), 35 | Input::get('target', 'email'), 36 | array('class' => 'form-control input-sm') 37 | ) 38 | }} 39 | 40 | 41 | 42 | 43 | 44 |
45 | {{ Form::close() }} 46 | 47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | id; ?> 60 | @foreach ($datas as $data) 61 | 62 | 63 | 64 | 65 | 66 | 73 | 74 | @endforeach 75 | 76 |
身份 {{ order_by('is_admin') }}邮箱 {{ order_by('email') }}注册时间 {{ order_by('created_at', 'desc') }}最后登录时间 {{ order_by('signin_at') }}操作
{{ $data->is_admin ? '管理员' : '普通用户' }}{{ $data->email }}{{ $data->created_at }}({{ $data->friendly_created_at }}){{ $data->signin_at }}({{ $data->friendly_signin_at }}) 67 | @if($data->id!=$currentId) 68 | 编辑 69 | 删除 71 | @endif 72 |
77 |
78 | 79 |
80 | {{ pagination($datas->appends(Input::except('page')), 'p.slider-3') }} 81 |
82 | 83 | 'myModal', 86 | 'title' => '系统提示', 87 | 'message' => '确认删除此'.$resourceName.'?', 88 | 'footer' => 89 | Form::open(array('id' => 'real-delete', 'method' => 'delete')).' 90 | 91 | '. 92 | Form::close(), 93 | ); 94 | ?> 95 | @include('w.modal', $modalData) 96 | 97 | @stop 98 | 99 | @section('end') 100 | @parent 101 | 108 | @stop 109 | 110 | -------------------------------------------------------------------------------- /app/views/authority/activationSuccess.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signin')) 2 | 3 | @section('title') 激活成功 @parent @stop 4 | 5 | @section('container') 6 | 7 |

账号激活成功

8 | 9 | @stop 10 | -------------------------------------------------------------------------------- /app/views/authority/email/activation.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.mail') 2 | @section('container') 3 |

感谢您注册 Simple - Blog,请点击以下链接激活您的账号: 4 |
{{ route('activate', $activationCode) }} 5 |

6 | @stop -------------------------------------------------------------------------------- /app/views/authority/email/forgotPassword.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.mail') 2 | @section('container') 3 |

请点击以下链接完成密码重置: 4 |
{{ route('reset', $token) }} 5 |

6 | @stop -------------------------------------------------------------------------------- /app/views/authority/password/remind.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signin')) 2 | 3 | @section('title') 忘记密码 @parent @stop 4 | 5 | @section('style') 6 | @parent 7 | .center 8 | { 9 | text-align: center; 10 | } 11 | .form-center, .alert-dismissable 12 | { 13 | float: none; 14 | margin: 0 auto; 15 | margin-top: 2em; 16 | } 17 | .input-group 18 | { 19 | margin-top: 2em; 20 | } 21 | @stop 22 | 23 | @section('container') 24 | 25 | {{ Form::open(array('class' => 'col-lg-6 form-center', 'role' => 'form')) }} 26 |

发送密码重置邮件

27 |
28 | 29 | 30 | 31 | 32 |
33 | @if( Session::get('error') ) 34 |
35 | 36 | {{ Session::get('error') }} 37 |
38 | @elseif( Session::get('status') ) 39 |
40 | 41 | {{ Session::get('status') }} 42 |
43 | @endif 44 | {{ Form::close() }} 45 | 46 | @stop 47 | -------------------------------------------------------------------------------- /app/views/authority/password/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signin')) 2 | 3 | @section('title') 密码重置 @parent @stop 4 | 5 | @section('style') 6 | @parent 7 | .form-register { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-register .form-register-heading, 13 | .form-register .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-register .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-register .form-control { 20 | position: relative; 21 | font-size: 16px; 22 | height: auto; 23 | padding: 10px; 24 | -webkit-box-sizing: border-box; 25 | -moz-box-sizing: border-box; 26 | box-sizing: border-box; 27 | } 28 | .form-register input{ 29 | margin-top: 10px; 30 | } 31 | .form-register button{ 32 | margin-top: 10px; 33 | } 34 | .form-register strong.error{ 35 | color: #b94a48; 36 | } 37 | @stop 38 | 39 | @section('container') 40 | 41 | {{ Form::open(array('class' => 'form-register', 'role' => 'form')) }} 42 |

密码重置

43 | 44 | {{ $errors->first('email', ':message') }} 45 |
46 | 47 | 48 | 49 | 50 |
51 | {{ $errors->first('password', ':message') }} 52 | 53 | 54 | @if( Session::get('error') ) 55 |
56 | 57 | {{ Session::get('error') }} 58 |
59 | @endif 60 | 61 | {{ Form::close() }} 62 | 63 | @stop 64 | 65 | @section('end') 66 | @parent 67 | 70 | @stop 71 | -------------------------------------------------------------------------------- /app/views/authority/signin.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signin')) 2 | 3 | @section('title') 登录 @parent @stop 4 | 5 | @section('style') 6 | @parent 7 | .form-signin { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signin .form-signin-heading, 13 | .form-signin .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signin .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signin .form-control { 20 | position: relative; 21 | font-size: 16px; 22 | height: auto; 23 | padding: 10px; 24 | -webkit-box-sizing: border-box; 25 | -moz-box-sizing: border-box; 26 | box-sizing: border-box; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="text"] { 32 | margin-bottom: 10px; 33 | border-bottom-left-radius: 0; 34 | border-bottom-right-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } 41 | @stop 42 | 43 | @section('container') 44 | 45 | {{ Form::open(array('class' => 'form-signin', 'role' => 'form')) }} 46 | 47 | 48 | 49 | 53 |
54 | 55 | {{ $errors->first('attempt') }} 56 |
57 | 58 | {{ Form::close() }} 59 | 60 | @stop -------------------------------------------------------------------------------- /app/views/authority/signup.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signup')) 2 | 3 | @section('title') 注册 @parent @stop 4 | 5 | @section('style') 6 | @parent 7 | .form-signup { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signup .form-signup-heading, 13 | .form-signup .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signup .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signup .form-control { 20 | position: relative; 21 | font-size: 16px; 22 | height: auto; 23 | padding: 10px; 24 | -webkit-box-sizing: border-box; 25 | -moz-box-sizing: border-box; 26 | box-sizing: border-box; 27 | } 28 | .form-signup input{ 29 | margin-top: 10px; 30 | } 31 | .form-signup button{ 32 | margin-top: 10px; 33 | } 34 | .form-signup strong.error{ 35 | color: #b94a48; 36 | } 37 | @stop 38 | 39 | @section('container') 40 | 41 | {{ Form::open(array('class' => 'form-signup', 'role' => 'form')) }} 42 | 43 | 44 | {{ $errors->first('email', ':message') }} 45 |
46 | 47 | 48 | 49 | 50 |
51 | {{ $errors->first('password', ':message') }} 52 | 53 | 54 | {{ Form::close() }} 55 | 56 | @stop 57 | 58 | 59 | @section('end') 60 | @parent 61 | 64 | @stop 65 | -------------------------------------------------------------------------------- /app/views/authority/signupSuccess.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.authority', array('active' => 'signin')) 2 | 3 | @section('title') 注册成功 @parent @stop 4 | 5 | @section('style') 6 | @parent 7 | .center 8 | { 9 | text-align: center; 10 | } 11 | @stop 12 | 13 | @section('container') 14 | 15 |

请激活您的账号

16 |

激活邮件已发送,请登录您的邮箱({{ $email }})激活账号。

17 | 18 | @stop 19 | -------------------------------------------------------------------------------- /app/views/blog/categoryArticles.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.blog', array('active' => 'home')) 2 | 3 | @section('container') 4 | 5 |
6 |
7 |
8 | 9 | @foreach($articles as $article) 10 |
11 |

12 | {{ $article->title }} 13 | 15 | 16 | 17 |

18 |

{{ close_tags(Str::limit($article->content_html, 200)) }}

19 |

20 | {{ $article->created_at }}({{ $article->friendly_created_at }}) 21 | 22 | 23 | 24 | 评论({{ $article->comments_count }}) 27 |

28 |
29 | @endforeach 30 | 31 |
32 | {{ pagination($articles, 'p.slider-3') }} 33 |
34 | 35 |
36 |
37 | 38 | @include('w.blogSidebar', array('activeCategory' => $category_id)) 39 | 40 |
41 | 42 | @stop 43 | -------------------------------------------------------------------------------- /app/views/blog/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.blog', array('active' => 'home')) 2 | 3 | @section('container') 4 | 5 |
6 |
7 |
8 | 9 | @foreach($articles as $article) 10 |
11 |

12 | {{ $article->title }} 13 | 15 | 16 | 17 |

18 |

{{ close_tags(Str::limit($article->content_html, 200)) }}

19 |

20 | {{ $article->created_at }}({{ $article->friendly_created_at }}) 21 | 22 | 23 | 24 | 评论({{ $article->comments_count }}) 27 |

28 |
29 | @endforeach 30 | 31 |
32 | {{ pagination($articles, 'p.slider-3') }} 33 |
34 | 35 |
36 |
37 | 38 | @include('w.blogSidebar', array('activeCategory' => 'all')) 39 | 40 |
41 | 42 | @stop 43 | -------------------------------------------------------------------------------- /app/views/blog/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.blog', array('active' => 'home')) 2 | 3 | @section('description'){{ $article->description }} @stop 4 | @section('keywords'){{ $article->keywords }} @stop 5 | @section('title'){{ $article->title }} - @parent @stop 6 | 7 | @section('container') 8 | 9 |
10 |
11 | 12 |
13 | 14 |
15 |

{{ $article->title }}

16 |
17 |

{{ $article->content_html }}

18 | 19 |

20 | {{ $article->created_at }}({{ $article->friendly_created_at }}) 21 |

22 |
23 | 24 |
25 |

评论 - {{ $article->comments_count }}

26 |
    27 | load('comments.user') ?> 28 | @foreach($article->comments as $comment) 29 |
  • 30 | 31 | 头像(小) 32 | 33 |
    34 |
    {{ $comment->user->email }} 35 | 发表于:{{ $comment->friendly_created_at }} 36 |
    37 | {{ $comment->content }} 38 |
    39 |
  • 40 | @endforeach 41 |
42 | @include('w.notification') 43 | @if(Auth::check()) 44 |
45 | 46 | 47 | 48 | 49 | {{ $errors->first('content', ':message') }} 50 | 51 |
52 | @else 53 |
54 |
55 | 登录 56 | 注册 57 |
58 | 59 |
60 | @endif 61 |
62 | 63 |
64 |
65 | 66 | @include('w.blogSidebar', array('activeCategory' => $article->category->id)) 67 | 68 |
69 | 70 | @stop 71 | -------------------------------------------------------------------------------- /app/views/l/.this.is.layouts.dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/views/l/.this.is.layouts.dir -------------------------------------------------------------------------------- /app/views/l/account.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.base') 2 | 3 | @section('title') 用户中心 @parent @stop 4 | 5 | @section('beforeStyle') 6 | {{ style('bootstrap-3.0.3') }} 7 | @parent @stop 8 | 9 | @section('style') 10 | body 11 | { 12 | padding-bottom: 0; 13 | background-color: #f3f3ff; 14 | } 15 | @parent @stop 16 | 17 | @section('body') 18 | 19 | @include('w.accountNavbar') 20 | 21 |
22 | @yield('container') 23 |
24 | 25 | @stop 26 | 27 | @section('end') 28 | {{ script('jquery-1.10.2', 'bootstrap-3.0.3') }} 29 | @parent @stop 30 | -------------------------------------------------------------------------------- /app/views/l/admin.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.base') 2 | 3 | @section('title') 后台 @parent @stop 4 | 5 | @section('beforeStyle') 6 | {{ style('bootstrap-3.0.3') }} 7 | @parent @stop 8 | 9 | @section('style') 10 | body 11 | { 12 | padding-bottom: 0; 13 | background-color: #f3f3ff; 14 | } 15 | @parent @stop 16 | 17 | @section('body') 18 | 19 | @include('w.adminNavbar') 20 | 21 |
22 | @yield('container') 23 |
24 | 25 | @stop 26 | 27 | 28 | @section('end') 29 | {{ script('jquery-1.10.2', 'bootstrap-3.0.3') }} 30 | @parent @stop 31 | -------------------------------------------------------------------------------- /app/views/l/authority.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.base') 2 | 3 | @section('title') Simple - Blog @parent @stop 4 | 5 | @section('beforeStyle') 6 | {{ style('bootstrap-3.0.3') }} 7 | @parent @stop 8 | 9 | @section('style') 10 | body 11 | { 12 | padding-bottom: 0; 13 | background-color: #f3f3ff; 14 | } 15 | @parent @stop 16 | 17 | @section('body') 18 | 19 | @include('w.blogNavbar') 20 | 21 |
22 | @yield('container') 23 |
24 | 25 | @stop 26 | 27 | @section('end') 28 | {{ script('jquery-1.10.2', 'bootstrap-3.0.3') }} 29 | @parent @stop 30 | -------------------------------------------------------------------------------- /app/views/l/base.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | @section('title') 11 | @show{{-- 页面标题 --}} 12 | 13 | {{-- 页面描述 --}} 14 | {{-- 页面关键词 --}} 15 | 16 | 19 | @section('beforeStyle') 20 | @show{{-- 页面内联样式之前 --}} 21 | 30 | @section('afterStyle') 31 | @show{{-- 页面内联样式之后 --}} 32 | 33 | 34 | 35 | 36 | @yield('body') 37 | 38 | @section('end') 39 | @show{{-- 页面主体之后 --}} 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/views/l/blog.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.base') 2 | 3 | @section('title') Simple - Blog @parent @stop 4 | 5 | @section('beforeStyle') 6 | {{ style('bootstrap-3.0.3') }} 7 | @parent @stop 8 | 9 | @section('style') 10 | body 11 | { 12 | padding-bottom: 0; 13 | background-color: #f3f3ff; 14 | } 15 | @parent @stop 16 | 17 | @section('body') 18 | 19 | @include('w.blogNavbar') 20 | 21 |
22 | @yield('container') 23 |
24 | 25 | @stop 26 | 27 | @section('end') 28 | {{ script('jquery-1.10.2', 'bootstrap-3.0.3') }} 29 | @parent @stop 30 | -------------------------------------------------------------------------------- /app/views/l/mail.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Simple - Blog

4 |
5 |
6 |

尊敬的用户:

7 |

您好!

8 | @yield('container') 9 |

Simple - Blog 运营团队

10 |

11 |

系统发信,请勿回复。

12 |
13 |
-------------------------------------------------------------------------------- /app/views/l/system.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{Config::get('extend.webSiteName')}}--@yield('title') 6 | 80 | 81 | 82 |
83 | @yield('container') 84 |
85 | 86 | 87 | -------------------------------------------------------------------------------- /app/views/p/.this.is.pagination.dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/views/p/.this.is.pagination.dir -------------------------------------------------------------------------------- /app/views/p/simple.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | @if($paginator->getLastPage()>1) 4 |
    5 | {{ $presenter->getPrevious('« 上一页', 'previous') }} 6 | {{ $presenter->getNext('下一页 »') }} 7 |
8 | @endif 9 | -------------------------------------------------------------------------------- /app/views/p/slider-3.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
    6 | {{ $presenter->render() }} 7 |
8 | -------------------------------------------------------------------------------- /app/views/p/slider.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | getLastPage() > 1): ?> 6 | 11 | -------------------------------------------------------------------------------- /app/views/system/.this.is.systems.dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/views/system/.this.is.systems.dir -------------------------------------------------------------------------------- /app/views/system/down.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.system') 2 | @section('title')503 @stop 3 | 4 | @section('container') 5 |

503 !

6 |

服务器维护中,请稍后再试。

7 | @stop -------------------------------------------------------------------------------- /app/views/system/error.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.system') 2 | @section('title')500 @stop 3 | 4 | @section('container') 5 |

500 !

6 |

服务器内部错误。

7 | @stop -------------------------------------------------------------------------------- /app/views/system/missing.blade.php: -------------------------------------------------------------------------------- 1 | @extends('l.system') 2 | @section('title')404 @stop 3 | 4 | @section('container') 5 |

404 !

6 |

抱歉,您请求的页面不存在。

7 |

可能是以下原因:

8 |
    9 |
  • 您输入了一个错误的地址
  • 10 |
  • 这是一个过时的链接
  • 11 |
12 | @include('w.googleSearch') 13 | @stop 14 | -------------------------------------------------------------------------------- /app/views/w/.this.is.widgets.dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/app/views/w/.this.is.widgets.dir -------------------------------------------------------------------------------- /app/views/w/accountNavbar.blade.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/views/w/adminNavbar.blade.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/views/w/blogNavbar.blade.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/views/w/blogSidebar.blade.php: -------------------------------------------------------------------------------- 1 | @section('style') 2 | @parent 3 | /* 4 | * 侧边栏切换样式支持 5 | * -------------------------------------------------- 6 | */ 7 | @media screen and (max-width: 767px) { 8 | .row-offcanvas { 9 | position: relative; 10 | -webkit-transition: all 0.25s ease-out; 11 | -moz-transition: all 0.25s ease-out; 12 | transition: all 0.25s ease-out; 13 | } 14 | 15 | .row-offcanvas-right 16 | .sidebar-offcanvas { 17 | right: -50%; /* 6 columns */ 18 | } 19 | 20 | .row-offcanvas-left 21 | .sidebar-offcanvas { 22 | left: -50%; /* 6 columns */ 23 | } 24 | 25 | .row-offcanvas-right.active { 26 | right: 50%; /* 6 columns */ 27 | } 28 | 29 | .row-offcanvas-left.active { 30 | left: 50%; /* 6 columns */ 31 | } 32 | 33 | .sidebar-offcanvas { 34 | position: absolute; 35 | top: 0; 36 | width: 50%; /* 6 columns */ 37 | } 38 | } 39 | @stop 40 | 41 | 50 | 51 | 63 | 64 | @section('end') 65 | @parent 66 | 73 | @stop -------------------------------------------------------------------------------- /app/views/w/googleAnalytics.blade.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/views/w/googleSearch.blade.php: -------------------------------------------------------------------------------- 1 | @section('style') 2 | /* google search */ 3 | 4 | #goog-fixurl ul { 5 | list-style: none; 6 | padding: 0; 7 | margin: 0; 8 | } 9 | 10 | #goog-fixurl form { 11 | margin: 0; 12 | } 13 | 14 | #goog-wm-qt, 15 | #goog-wm-sb { 16 | border: 1px solid #bbb; 17 | font-size: 16px; 18 | line-height: normal; 19 | vertical-align: top; 20 | color: #444; 21 | border-radius: 2px; 22 | } 23 | 24 | #goog-wm-qt { 25 | width: 220px; 26 | height: 20px; 27 | padding: 5px; 28 | margin: 5px 10px 0 0; 29 | box-shadow: inset 0 1px 1px #ccc; 30 | } 31 | 32 | #goog-wm-sb { 33 | display: inline-block; 34 | height: 32px; 35 | padding: 0 10px; 36 | margin: 5px 0 0; 37 | white-space: nowrap; 38 | cursor: pointer; 39 | background-color: #f5f5f5; 40 | background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); 41 | background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); 42 | background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); 43 | background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); 44 | -webkit-appearance: none; 45 | -moz-appearance: none; 46 | appearance: none; 47 | *overflow: visible; 48 | *display: inline; 49 | *zoom: 1; 50 | } 51 | 52 | #goog-wm-sb:hover, 53 | #goog-wm-sb:focus { 54 | border-color: #aaa; 55 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); 56 | background-color: #f8f8f8; 57 | } 58 | 59 | #goog-wm-qt:hover, 60 | #goog-wm-qt:focus { 61 | border-color: #105cb6; 62 | outline: 0; 63 | color: #222; 64 | } 65 | @parent @stop 66 | 67 | 71 | -------------------------------------------------------------------------------- /app/views/w/killIE6.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/w/modal.blade.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/views/w/notification.blade.php: -------------------------------------------------------------------------------- 1 | @if ($message = Session::get('success')) 2 |
3 | 4 | {{ $message }} 5 |
6 | @endif 7 | 8 | @if ($message = Session::get('error')) 9 |
10 | 11 | {{ $message }} 12 |
13 | @endif 14 | 15 | @if ($message = Session::get('warning')) 16 |
17 | 18 | {{ $message }} 19 |
20 | @endif 21 | 22 | @if ($message = Session::get('info')) 23 |
24 | 25 | {{ $message }} 26 |
27 | @endif 28 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setRequestForConsoleEnvironment(); 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('your-machine-name'), 30 | 31 | )); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Bind Paths 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here we are binding the paths configured in paths.php to the app. You 39 | | should not be changing these here. If you need to change these you 40 | | may do so within the paths.php file and they will be bound here. 41 | | 42 | */ 43 | 44 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Load The Application 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here we will load this Illuminate application. We will keep this in a 52 | | separate location so we can isolate the creation of an application 53 | | from the actual running of the application with a given request. 54 | | 55 | */ 56 | 57 | $framework = $app['path.base']. 58 | '/vendor/laravel/framework/src'; 59 | 60 | require $framework.'/Illuminate/Foundation/start.php'; 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Return The Application 65 | |-------------------------------------------------------------------------- 66 | | 67 | | This script returns the application instance. The instance is given to 68 | | the calling script so we can separate the building of the instances 69 | | from the actual running of the application and sending responses. 70 | | 71 | */ 72 | 73 | return $app; 74 | -------------------------------------------------------------------------------- /change-db.md: -------------------------------------------------------------------------------- 1 | # 将项目数据库依赖变更为其它数据库的方法 2 | 3 | > 2014-09-09 为避免对新人产生错误引导,移除开发辅助工具(不规范),采用常规化的迁移与填充流程。 4 | 5 | ## 详细步骤(下面以 mysql 为例) 6 | 7 | 1、修改数据库配置文件 `/app/config/database.php` 29 行。 8 | 9 | ```php 10 | // 'default' => 'sqlite', 11 | 'default' => 'mysql', 12 | ``` 13 | 14 | > 注意:55 行开始的 mysql 连接配置,请根据自己的需要修改 15 | 16 | ```php 17 | 'mysql' => array( 18 | 'driver' => 'mysql', 19 | 'host' => 'localhost', 20 | 'database' => 'laravel-4.1-simple-blog', 21 | 'username' => 'root', 22 | 'password' => '', 23 | 'charset' => 'utf8', 24 | // 'collation' => 'utf8_unicode_ci', 25 | 'collation' => 'utf8_general_ci', 26 | 'prefix' => 'l4_', 27 | ), 28 | ``` 29 | 30 | 2、执行 `php artisan migrate` 命令完成数据库的迁移(含基础数据) 31 | 32 | > 以下为反馈信息 33 | 34 | ``` 35 | Migration table created successfully. 36 | Migrated: 2014_09_09_135540_create_authority_tables 37 | Migrated: 2014_09_09_141726_create_blog_tables 38 | [Finished in 5.2s] 39 | ``` 40 | 41 | 3、执行 `php artisan db:seed` 命令完成测试数据填充 42 | 43 | > 以下为反馈信息 44 | 45 | ``` 46 | 测试用户数据填充完毕 47 | Seeded: AuthorityTablesSeeder 48 | 测试分类数据填充完毕 49 | 随机文章数据填充完毕 50 | PSR 系列文章数据填充完毕 51 | 随机评论数据填充完毕 52 | Seeded: BlogTablesSeeder 53 | [Finished in 38.9s] 54 | ``` 55 | 56 | > 注意:由于迁移文件是 UTF-8 格式,因此在 Win 下执行的话,以上信息的中文部分会显示为乱码,但并不影响正常使用。 -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "five-say/laravel-4.1-simple-blog", 3 | "description": "laravel-4.1-simple-blog.", 4 | "keywords": ["blog", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.1.*", 8 | "five-say/laravel-route-group": "1.*", 9 | "five-say/laravel-schema-extend": "1.*", 10 | "intervention/image": "2.*", 11 | "yzalis/identicon": "1.*", 12 | "michelf/php-markdown": "1.4.0", 13 | "nickcernis/html-to-markdown": "dev-master" 14 | }, 15 | "require-dev": { 16 | "barryvdh/laravel-debugbar": "1.*", 17 | "raveren/kint": "v0.9" 18 | }, 19 | "autoload": { 20 | "classmap": [ 21 | "app/commands", 22 | "app/controllers", 23 | "app/models", 24 | "app/database/migrations", 25 | "app/database/seeds", 26 | "app/tests/TestCase.php" 27 | ] 28 | }, 29 | "scripts": { 30 | "post-install-cmd": [ 31 | "php artisan clear-compiled", 32 | "php artisan optimize" 33 | ], 34 | "post-update-cmd": [ 35 | "php artisan clear-compiled", 36 | "php artisan optimize", 37 | "php artisan debugbar:publish" 38 | ], 39 | "post-create-project-cmd": [ 40 | "php artisan key:generate" 41 | ] 42 | }, 43 | "config": { 44 | "preferred-install": "dist" 45 | }, 46 | "minimum-stability": "stable" 47 | } 48 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/assets/bootstrap-2.3.2/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/bootstrap-2.3.2/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/assets/bootstrap-2.3.2/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/bootstrap-2.3.2/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/assets/bootstrap-markdown/README.md: -------------------------------------------------------------------------------- 1 | ## Bootstrap Markdown 2 | 3 | Markdown editing meet Bootstrap. 4 | 5 | | Version | Compatibility with Bootstrap | 6 | | :---: | :---: | 7 | | Bootstrap Markdown v2.x | **only** compatible with Bootstrap 3.x | 8 | | Bootstrap Markdown v1.x | **only** compatible with Bootstrap 2.x | 9 | 10 | Demo and documentation on [http://toopay.github.com/bootstrap-markdown/](http://toopay.github.com/bootstrap-markdown/) 11 | 12 | ### LICENSE 13 | 14 | > Copyright 2013 Taufan Aditya 15 | > 16 | > Licensed under the Apache License, Version 2.0 (the "License"); 17 | > you may not use this file except in compliance with the License. 18 | > You may obtain a copy of the License at 19 | > 20 | > http://www.apache.org/licenses/LICENSE-2.0 21 | > 22 | > Unless required by applicable law or agreed to in writing, software 23 | > distributed under the License is distributed on an "AS IS" BASIS, 24 | > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | > See the License for the specific language governing permissions and 26 | > limitations under the License. -------------------------------------------------------------------------------- /public/assets/bootstrap-markdown/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-markdown", 3 | "version": "2.2.1", 4 | "main": ["./js/bootstrap-markdown.js", "./css/bootstrap-markdown.min.css"], 5 | "dependencies": { 6 | "bootstrap": "~3.0.0" 7 | }, 8 | "devDependencies": { 9 | "markdown":"~0.4.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /public/assets/bootstrap-markdown/css/bootstrap-markdown.min.css: -------------------------------------------------------------------------------- 1 | .md-editor{display:block;border:1px solid #ddd}.md-editor>.md-header,.md-editor .md-footer{display:block;padding:6px 4px;background:#fff}.md-editor>.md-preview{background:#fff;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;min-height:10px}.md-editor>textarea{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:14px;outline:0;outline:thin dotted \9;margin:0;display:block;padding:0;width:100%;border:0;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;border-radius:0;box-shadow:none;background:#eee}.md-editor>textarea:focus{box-shadow:none;background:#fff}.md-editor.active{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6)} -------------------------------------------------------------------------------- /public/assets/bootstrap-markdown/less/bootstrap-markdown.less: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap-Markdown.less 3 | * 4 | * @author Taufan Aditya @taufanaditya 5 | * @copyright 2013 Taufan Aditya 6 | */ 7 | 8 | @import "variables.less"; // Point this into your bootstrap variables 9 | @import "mixins.less"; // Point this into your bootstrap variables 10 | 11 | .md-editor { 12 | display: block; 13 | border: 1px solid @table-border-color; 14 | 15 | > .md-header, .md-footer { 16 | display: block; 17 | padding: 6px 4px; 18 | background: @panel-default-heading-bg; 19 | } 20 | 21 | > .md-preview { 22 | background: @panel-bg; 23 | border-top: 1px dashed @table-border-color; 24 | border-bottom: 1px dashed @table-border-color; 25 | min-height: 10px; 26 | } 27 | 28 | > textarea { 29 | font-family: @font-family-monospace; 30 | font-size: @font-size-base; 31 | outline: 0; 32 | outline: thin dotted \9; /* IE6-9 */ 33 | margin: 0; 34 | display: block; 35 | padding: 0; 36 | width: 100%; 37 | border: 0; 38 | border-top: 1px dashed @table-border-color; 39 | border-bottom: 1px dashed @table-border-color; 40 | border-radius: 0; 41 | box-shadow: none; 42 | background: @input-bg-disabled; 43 | &:focus { 44 | box-shadow: none; 45 | background: @input-bg; 46 | } 47 | } 48 | 49 | // Hover state 50 | @color: @input-border-focus; 51 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 52 | &.active { 53 | border-color: @color; 54 | outline: 0; 55 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /public/assets/bootstrap-markdown/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-markdown", 3 | "filename": "js/bootstrap-markdown.js", 4 | "version": "2.2.1", 5 | "description": "A bootstrap plugin for markdown editing", 6 | "homepage": "https://github.com/toopay/bootstrap-markdown", 7 | "keywords": [ 8 | "twitter", 9 | "bootstrap", 10 | "markdown", 11 | "editor" 12 | ], 13 | "maintainers": [{ 14 | "name": "Taufan Aditya", 15 | "web": "https://github.com/toopay" 16 | }], 17 | "repositories": [{ 18 | "type": "git", 19 | "url": "https://github.com/toopay/bootstrap-markdown.git" 20 | }] 21 | } 22 | -------------------------------------------------------------------------------- /public/assets/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * bootstrap-switch - v2.0.1 3 | * http://www.bootstrap-switch.org 4 | * ======================================================================== 5 | * Copyright 2012-2013 Mattia Larentis 6 | * 7 | * ======================================================================== 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * ======================================================================== 20 | */ 21 | 22 | .has-switch{display:inline-block;cursor:pointer;border-radius:4px;border:1px solid;border-color:#ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;vertical-align:middle;min-width:100px;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.has-switch:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.has-switch.switch-mini{min-width:72px}.has-switch.switch-mini label,.has-switch.switch-mini span{padding-bottom:4px;padding-top:4px;font-size:10px;line-height:9px}.has-switch.switch-mini i.switch-mini-icons{height:1.2em;line-height:9px;vertical-align:text-top;text-align:center;transform:scale(0.6);margin-top:-1px;margin-bottom:-1px}.has-switch.switch-small{min-width:80px}.has-switch.switch-small label,.has-switch.switch-small span{padding-bottom:3px;padding-top:3px;font-size:12px;line-height:18px}.has-switch.switch-large{min-width:120px}.has-switch.switch-large label,.has-switch.switch-large span{padding-bottom:9px;padding-top:9px;font-size:16px;line-height:normal}.has-switch.switch-animate>div{-webkit-transition:left .5s;transition:left .5s}.has-switch.switch-off>div{left:-50%}.has-switch.switch-on>div{left:0}.has-switch.disabled{opacity:.5;filter:alpha(opacity=50);cursor:default!important}.has-switch.disabled label,.has-switch.disabled span{cursor:default!important}.has-switch>div{display:inline-block;width:150%;position:relative;top:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.has-switch input[type=checkbox],.has-switch input[type=radio]{display:none}.has-switch label,.has-switch span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;position:relative;display:inline-block!important;height:100%;padding-bottom:4px;padding-top:4px;font-size:14px;line-height:20px}.has-switch label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;width:33.333333333%;background:#fff}.has-switch label i{color:#000;text-shadow:0 1px 0 #fff;line-height:18px;pointer-events:none}.has-switch span{text-align:center;z-index:1;width:33.333333333%}.has-switch span.switch-left{border-bottom-left-radius:4px;border-top-left-radius:4px}.has-switch span.switch-right{color:#000;background:#eee}.has-switch span.switch-left,.has-switch span.switch-primary{color:#fff;background:#428bca}.has-switch span.switch-info{color:#fff;background:#5bc0de}.has-switch span.switch-success{color:#fff;background:#5cb85c}.has-switch span.switch-warning{background:#f0ad4e;color:#fff}.has-switch span.switch-danger{color:#fff;background:#d9534f}.has-switch span.switch-default{color:#000;background:#eee} -------------------------------------------------------------------------------- /public/assets/css/main.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/css/main.css -------------------------------------------------------------------------------- /public/assets/img/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/img/.gitignore -------------------------------------------------------------------------------- /public/assets/img/5-say-modules.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/assets/img/5-say-modules.jpg -------------------------------------------------------------------------------- /public/assets/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/assets/js/plugins.js: -------------------------------------------------------------------------------- 1 | // Avoid `console` errors in browsers that lack a console. 2 | (function() { 3 | var method; 4 | var noop = function () {}; 5 | var methods = [ 6 | 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 7 | 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 8 | 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 9 | 'timeStamp', 'trace', 'warn' 10 | ]; 11 | var length = methods.length; 12 | var console = (window.console = window.console || {}); 13 | 14 | while (length--) { 15 | method = methods[length]; 16 | 17 | // Only stub undefined methods. 18 | if (!console[method]) { 19 | console[method] = noop; 20 | } 21 | } 22 | }()); 23 | 24 | // Place any jQuery/helper plugins in here. 25 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/icons.png -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/laravel-debugbar.css: -------------------------------------------------------------------------------- 1 | div.phpdebugbar { 2 | font-size: 13px; 3 | font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; 4 | } 5 | 6 | div.phpdebugbar-header, div.phpdebugbar-openhandler-header { 7 | background: #efefef url(laravel-icon.png) no-repeat 4px 3px; 8 | background-size: 20px; 9 | line-height: 17px; 10 | } 11 | a.phpdebugbar-restore-btn { 12 | background: #efefef url(laravel-icon.png) no-repeat 5px 3px; 13 | background-size: 20px; 14 | width: 16px; 15 | border-right-color: #ccc; 16 | } 17 | 18 | div.phpdebugbar-header > div > * { 19 | font-size: 13px; 20 | } 21 | 22 | div.phpdebugbar-header .phpdebugbar-tab { 23 | padding: 5px 6px; 24 | } 25 | 26 | div.phpdebugbar .phpdebugbar-header select{ 27 | padding: 1px 0; 28 | } 29 | 30 | dl.phpdebugbar-widgets-kvlist dt{ 31 | width: 200px; 32 | } 33 | 34 | dl.phpdebugbar-widgets-kvlist dd { 35 | margin-left: 210px; 36 | } 37 | 38 | ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-value { 39 | height: 20px; 40 | top: 0; 41 | background-color: #f4645f; 42 | } 43 | 44 | ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-label { 45 | top: 2px; 46 | } 47 | 48 | div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter { 49 | background-color: #f4645f; 50 | } 51 | 52 | a.phpdebugbar-tab.phpdebugbar-active { 53 | background: #f4645f; 54 | color: #fff; 55 | } 56 | 57 | a.phpdebugbar-tab.phpdebugbar-active span.phpdebugbar-badge { 58 | background-color: white; 59 | color: #f4645f; 60 | } 61 | 62 | a.phpdebugbar-tab span.phpdebugbar-badge { 63 | background: #f4645f; 64 | color: #fff; 65 | } 66 | 67 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-header { 68 | background: #efefef url(laravel-icon.png) no-repeat 4px 3px; 69 | background-size: 20px; 70 | } 71 | 72 | div.phpdebugbar-openhandler table{ 73 | table-layout: fixed; 74 | } 75 | 76 | div.phpdebugbar-openhandler table td, div.phpdebugbar-openhandler table th{ 77 | text-align: left; 78 | } 79 | 80 | div.phpdebugbar-openhandler table td a{ 81 | display: block; 82 | white-space: nowrap; 83 | overflow: hidden; 84 | text-overflow: ellipsis; 85 | } 86 | -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/laravel-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/laravel-icon.png -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/openhandler.css: -------------------------------------------------------------------------------- 1 | div.phpdebugbar-openhandler-overlay { 2 | position: fixed; 3 | left: 0; 4 | top: 0; 5 | width: 100%; 6 | height: 100%; 7 | background: #000; 8 | opacity: .3; 9 | z-index: 20000; 10 | } 11 | 12 | div.phpdebugbar-openhandler { 13 | position: fixed; 14 | margin: auto; 15 | top: 0; 16 | bottom: 0; 17 | left: 0; 18 | right: 0; 19 | width: 70%; 20 | height: 70%; 21 | background: #fff; 22 | border: 2px solid #888; 23 | overflow: auto; 24 | z-index: 20001; 25 | font-family: arial; 26 | font-size: 14px; 27 | padding-bottom: 10px; 28 | } 29 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-header { 30 | background: #efefef url(php-icon.png) no-repeat 5px 4px; 31 | padding-left: 29px; 32 | min-height: 26px; 33 | line-height: 25px; 34 | color: #555; 35 | margin-bottom: 10px; 36 | } 37 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-header a { 38 | font-size: 14px; 39 | color: #555; 40 | text-decoration: none; 41 | float: right; 42 | padding: 5px 8px; 43 | } 44 | div.phpdebugbar-openhandler table { 45 | width: 100%; 46 | font-size: 14px; 47 | } 48 | div.phpdebugbar-openhandler table td { 49 | padding: 6px 3px; 50 | text-align: center; 51 | border-bottom: 1px solid #ddd; 52 | } 53 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions { 54 | text-align: center; 55 | padding: 7px 0; 56 | } 57 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions a { 58 | margin: 0 10px; 59 | color: #555; 60 | } 61 | -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/php-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/php-icon.png -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/barryvdh/laravel-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/icons.png -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/openhandler.css: -------------------------------------------------------------------------------- 1 | div.phpdebugbar-openhandler-overlay { 2 | position: fixed; 3 | left: 0; 4 | top: 0; 5 | width: 100%; 6 | height: 100%; 7 | background: #000; 8 | opacity: .3; 9 | z-index: 20000; 10 | } 11 | 12 | div.phpdebugbar-openhandler { 13 | position: fixed; 14 | margin: auto; 15 | top: 0; 16 | bottom: 0; 17 | left: 0; 18 | right: 0; 19 | width: 70%; 20 | height: 70%; 21 | background: #fff; 22 | border: 2px solid #888; 23 | overflow: auto; 24 | z-index: 20001; 25 | font-family: arial; 26 | font-size: 14px; 27 | padding-bottom: 10px; 28 | } 29 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-header { 30 | background: #efefef url(php-icon.png) no-repeat 5px 4px; 31 | padding-left: 29px; 32 | min-height: 26px; 33 | line-height: 25px; 34 | color: #555; 35 | margin-bottom: 10px; 36 | } 37 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-header a { 38 | font-size: 14px; 39 | color: #555; 40 | text-decoration: none; 41 | float: right; 42 | padding: 5px 8px; 43 | } 44 | div.phpdebugbar-openhandler table { 45 | width: 100%; 46 | font-size: 14px; 47 | } 48 | div.phpdebugbar-openhandler table td { 49 | padding: 6px 3px; 50 | text-align: center; 51 | border-bottom: 1px solid #ddd; 52 | } 53 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions { 54 | text-align: center; 55 | padding: 7px 0; 56 | } 57 | div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions a { 58 | margin: 0 10px; 59 | color: #555; 60 | } 61 | -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/php-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/php-icon.png -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/packages/maximebf/php-debugbar/vendor/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/vendor/highlightjs/styles/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; padding: 0.5em; 9 | color: #333; 10 | background: #f8f8f8 11 | } 12 | 13 | .hljs-comment, 14 | .hljs-template_comment, 15 | .diff .hljs-header, 16 | .hljs-javadoc { 17 | color: #998; 18 | font-style: italic 19 | } 20 | 21 | .hljs-keyword, 22 | .css .rule .hljs-keyword, 23 | .hljs-winutils, 24 | .javascript .hljs-title, 25 | .nginx .hljs-title, 26 | .hljs-subst, 27 | .hljs-request, 28 | .hljs-status { 29 | color: #333; 30 | font-weight: bold 31 | } 32 | 33 | .hljs-number, 34 | .hljs-hexcolor, 35 | .ruby .hljs-constant { 36 | color: #099; 37 | } 38 | 39 | .hljs-string, 40 | .hljs-tag .hljs-value, 41 | .hljs-phpdoc, 42 | .tex .hljs-formula { 43 | color: #d14 44 | } 45 | 46 | .hljs-title, 47 | .hljs-id, 48 | .coffeescript .hljs-params, 49 | .scss .hljs-preprocessor { 50 | color: #900; 51 | font-weight: bold 52 | } 53 | 54 | .javascript .hljs-title, 55 | .lisp .hljs-title, 56 | .clojure .hljs-title, 57 | .hljs-subst { 58 | font-weight: normal 59 | } 60 | 61 | .hljs-class .hljs-title, 62 | .haskell .hljs-type, 63 | .vhdl .hljs-literal, 64 | .tex .hljs-command { 65 | color: #458; 66 | font-weight: bold 67 | } 68 | 69 | .hljs-tag, 70 | .hljs-tag .hljs-title, 71 | .hljs-rules .hljs-property, 72 | .django .hljs-tag .hljs-keyword { 73 | color: #000080; 74 | font-weight: normal 75 | } 76 | 77 | .hljs-attribute, 78 | .hljs-variable, 79 | .lisp .hljs-body { 80 | color: #008080 81 | } 82 | 83 | .hljs-regexp { 84 | color: #009926 85 | } 86 | 87 | .hljs-symbol, 88 | .ruby .hljs-symbol .hljs-string, 89 | .lisp .hljs-keyword, 90 | .tex .hljs-special, 91 | .hljs-prompt { 92 | color: #990073 93 | } 94 | 95 | .hljs-built_in, 96 | .lisp .hljs-title, 97 | .clojure .hljs-built_in { 98 | color: #0086b3 99 | } 100 | 101 | .hljs-preprocessor, 102 | .hljs-pragma, 103 | .hljs-pi, 104 | .hljs-doctype, 105 | .hljs-shebang, 106 | .hljs-cdata { 107 | color: #999; 108 | font-weight: bold 109 | } 110 | 111 | .hljs-deletion { 112 | background: #fdd 113 | } 114 | 115 | .hljs-addition { 116 | background: #dfd 117 | } 118 | 119 | .diff .hljs-change { 120 | background: #0086b3 121 | } 122 | 123 | .hljs-chunk { 124 | color: #aaa 125 | } 126 | -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/widgets/mails/widget.css: -------------------------------------------------------------------------------- 1 | 2 | div.phpdebugbar-widgets-mails span.phpdebugbar-widgets-subject { 3 | display: block; 4 | } 5 | 6 | div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-headers { 7 | display: none; 8 | margin: 10px; 9 | padding: 5px; 10 | border: 1px solid #ddd; 11 | font-family: monospace; 12 | } 13 | -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/widgets/mails/widget.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 3 | var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-'); 4 | 5 | /** 6 | * Widget for the displaying mails data 7 | * 8 | * Options: 9 | * - data 10 | */ 11 | var MailsWidget = PhpDebugBar.Widgets.MailsWidget = PhpDebugBar.Widget.extend({ 12 | 13 | className: csscls('mails'), 14 | 15 | render: function() { 16 | this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, mail) { 17 | $('').addClass(csscls('subject')).text(mail.subject).appendTo(li); 18 | $('').addClass(csscls('to')).text(mail.to).appendTo(li); 19 | if (mail.headers) { 20 | var headers = $('
').addClass(csscls('headers')).appendTo(li);
21 |                     $('').text(mail.headers).appendTo(headers);
22 |                     li.click(function() {
23 |                         if (headers.is(':visible')) {
24 |                             headers.hide();
25 |                         } else {
26 |                             headers.show();
27 |                         }
28 |                     });
29 |                 }
30 |             }});
31 |             this.$list.$el.appendTo(this.$el);
32 | 
33 |             this.bindAttr('data', function(data) {
34 |                 this.$list.set('data', data);
35 |             });
36 |         }
37 | 
38 |     });
39 | 
40 | })(PhpDebugBar.$);
41 | 


--------------------------------------------------------------------------------
/public/packages/maximebf/php-debugbar/widgets/sqlqueries/widget.css:
--------------------------------------------------------------------------------
 1 | div.phpdebugbar-widgets-sqlqueries .phpdebugbar-widgets-status {
 2 |   font-family: monospace;
 3 |   padding: 6px 6px;
 4 |   border-bottom: 1px solid #ddd;
 5 |   font-weight: bold;
 6 |   color: #555;
 7 |   background: #fafafa;
 8 | }
 9 | 
10 | div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-error {
11 |   color: red;
12 | }
13 | 
14 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration,
15 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory,
16 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count,
17 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id {
18 |   float: right;
19 |   margin-left: 8px;
20 |   color: #888;
21 | }
22 | div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-duration,
23 | div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory,
24 | div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-row-count,
25 | div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-stmt-id {
26 |   color: #555;
27 | }
28 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before,
29 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before,
30 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before,
31 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
32 |   font-family: FontAwesome;
33 |   margin-right: 4px;
34 |   font-size: 12px;
35 | }
36 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before {
37 |   content: "\f017";
38 | }
39 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before {
40 |   content: "\f085";
41 | }
42 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before {
43 |   content: "\f0ce";
44 | }
45 | div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
46 |   content: "\f08d";
47 | }
48 | div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params {
49 |   display: none;
50 |   width: 70%;
51 |   margin: 10px;
52 |   border: 1px solid #ddd;
53 |   font-family: monospace;
54 |   border-collapse: collapse;
55 | }
56 |   div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params td {
57 |     border: 1px solid #ddd;
58 |     text-align: center;
59 |   }
60 |   div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
61 |     width: 20%;
62 |     font-weight: bold;
63 |   }
64 | 
65 | div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-error {
66 |   display: block;
67 |   font-weight: bold;
68 | }
69 | 
70 | code.phpdebugbar-widgets-sql {
71 |   white-space: pre-wrap;
72 |   overflow-wrap: break-word;
73 |   word-wrap: break-word;
74 | }
75 | 
76 | div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
77 |   background-color: #edeff0;
78 | }
79 | 
80 | div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate:hover {
81 |   background-color: #ffc;
82 | }
83 | 


--------------------------------------------------------------------------------
/public/packages/maximebf/php-debugbar/widgets/sqlqueries/widget.js:
--------------------------------------------------------------------------------
 1 | (function($) {
 2 | 
 3 |     var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
 4 | 
 5 |     /**
 6 |      * Widget for the displaying sql queries
 7 |      *
 8 |      * Options:
 9 |      *  - data
10 |      */
11 |     var SQLQueriesWidget = PhpDebugBar.Widgets.SQLQueriesWidget = PhpDebugBar.Widget.extend({
12 | 
13 |         className: csscls('sqlqueries'),
14 | 
15 |         render: function() {
16 |             this.$status = $('
').addClass(csscls('status')).appendTo(this.$el); 17 | 18 | this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, stmt) { 19 | $('').addClass(csscls('sql')).html(PhpDebugBar.Widgets.highlight(stmt.sql, 'sql')).appendTo(li); 20 | if (stmt.duration_str) { 21 | $('').addClass(csscls('duration')).text(stmt.duration_str).appendTo(li); 22 | } 23 | if (stmt.memory_str) { 24 | $('').addClass(csscls('memory')).text(stmt.memory_str).appendTo(li); 25 | } 26 | if (typeof(stmt.is_success) != 'undefined' && !stmt.is_success) { 27 | li.addClass(csscls('error')); 28 | li.append($('').addClass(csscls('error')).text("[" + stmt.error_code + "] " + stmt.error_message)); 29 | } else if (typeof(stmt.row_count) != 'undefined') { 30 | $('').addClass(csscls('row-count')).text(stmt.row_count).appendTo(li); 31 | } 32 | if (typeof(stmt.stmt_id) != 'undefined' && stmt.stmt_id) { 33 | $('').addClass(csscls('stmt-id')).text(stmt.stmt_id).appendTo(li); 34 | } 35 | if (stmt.params && !$.isEmptyObject(stmt.params)) { 36 | var table = $('
Params
').addClass(csscls('params')).appendTo(li); 37 | for (var key in stmt.params) { 38 | if (typeof stmt.params[key] !== 'function') { 39 | table.append('' + key + '' + stmt.params[key] + ''); 41 | } 42 | } 43 | li.css('cursor', 'pointer').click(function() { 44 | if (table.is(':visible')) { 45 | table.hide(); 46 | } else { 47 | table.show(); 48 | } 49 | }); 50 | } 51 | }}); 52 | this.$list.$el.appendTo(this.$el); 53 | 54 | this.bindAttr('data', function(data) { 55 | this.$list.set('data', data.statements); 56 | this.$status.empty(); 57 | 58 | // Search for duplicate statements. 59 | for (var sql = {}, duplicate = 0, i = 0; i < data.statements.length; i++) { 60 | var stmt = data.statements[i].sql; 61 | if (data.statements[i].params && !$.isEmptyObject(data.statements[i].params)) { 62 | stmt += ' {' + $.param(data.statements[i].params, false) + '}'; 63 | } 64 | sql[stmt] = sql[stmt] || { keys: [] }; 65 | sql[stmt].keys.push(i); 66 | } 67 | // Add classes to all duplicate SQL statements. 68 | for (var stmt in sql) { 69 | if (sql[stmt].keys.length > 1) { 70 | duplicate++; 71 | for (var i = 0; i < sql[stmt].keys.length; i++) { 72 | this.$list.$el.find('.' + csscls('list-item')).eq(sql[stmt].keys[i]) 73 | .addClass(csscls('sql-duplicate')).addClass(csscls('sql-duplicate-'+duplicate)); 74 | } 75 | } 76 | } 77 | 78 | var t = $('').text(data.nb_statements + " statements were executed").appendTo(this.$status); 79 | if (data.nb_failed_statements) { 80 | t.append(", " + data.nb_failed_statements + " of which failed"); 81 | } 82 | if (duplicate) { 83 | t.append(", " + duplicate + " of which were duplicated"); 84 | } 85 | if (data.accumulated_duration_str) { 86 | this.$status.append($('').addClass(csscls('duration')).text(data.accumulated_duration_str)); 87 | } 88 | if (data.memory_usage_str) { 89 | this.$status.append($('').addClass(csscls('memory')).text(data.memory_usage_str)); 90 | } 91 | }); 92 | } 93 | 94 | }); 95 | 96 | })(PhpDebugBar.$); 97 | -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/widgets/templates/widget.css: -------------------------------------------------------------------------------- 1 | 2 | div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status { 3 | font-family: monospace; 4 | padding: 6px 6px; 5 | border-bottom: 1px solid #ddd; 6 | font-weight: bold; 7 | color: #555; 8 | background: #fafafa; 9 | } 10 | 11 | div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render_time { 12 | float: right; 13 | } 14 | div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render_time:before { 15 | content: "\f017"; 16 | font-family: FontAwesome; 17 | font-size: 12px; 18 | margin-right: 4px; 19 | } 20 | 21 | div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-render_time { 22 | color: #555; 23 | } -------------------------------------------------------------------------------- /public/packages/maximebf/php-debugbar/widgets/templates/widget.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 3 | var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-'); 4 | 5 | /** 6 | * Widget for the displaying templates data 7 | * 8 | * Options: 9 | * - data 10 | */ 11 | var TemplatesWidget = PhpDebugBar.Widgets.TemplatesWidget = PhpDebugBar.Widget.extend({ 12 | 13 | className: csscls('templates'), 14 | 15 | render: function() { 16 | this.$status = $('
').addClass(csscls('status')).appendTo(this.$el); 17 | 18 | this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, tpl) { 19 | $('').addClass(csscls('name')).text(tpl.name).appendTo(li); 20 | if (tpl.render_time_str) { 21 | $('').addClass(csscls('render_time')).text(tpl.render_time_str).appendTo(li); 22 | } 23 | }}); 24 | this.$list.$el.appendTo(this.$el); 25 | 26 | this.bindAttr('data', function(data) { 27 | this.$list.set('data', data.templates); 28 | var sentence = data.sentence || "templates were rendered"; 29 | this.$status.empty().append($('').text(data.templates.length + " " + sentence)); 30 | if (data.accumulated_render_time_str) { 31 | this.$status.append($('').addClass(csscls('render_time')).text(data.accumulated_render_time_str)); 32 | } 33 | }); 34 | } 35 | 36 | }); 37 | 38 | })(PhpDebugBar.$); -------------------------------------------------------------------------------- /public/portrait/large/.size.220: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/portrait/large/.size.220 -------------------------------------------------------------------------------- /public/portrait/medium/.size.128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/portrait/medium/.size.128 -------------------------------------------------------------------------------- /public/portrait/small/.size.64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/portrait/small/.size.64 -------------------------------------------------------------------------------- /public/readmeAssets/mx3540D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/readmeAssets/mx3540D.png -------------------------------------------------------------------------------- /public/readmeAssets/mx3826D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/readmeAssets/mx3826D.png -------------------------------------------------------------------------------- /public/readmeAssets/mx384D1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/readmeAssets/mx384D1.png -------------------------------------------------------------------------------- /public/readmeAssets/mx3D2BE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5-say/laravel-4.1-simple-blog/579606b14d32566413b6a9e701391c5f45b0a7f6/public/readmeAssets/mx3D2BE.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # laravel-4.1-simple-blog 2 | 3 | - 这是一个 laravel-4.1 的 Demo,一个简单的博客实例。 4 | - 涵盖知识点: 5 | - 路由、过滤器。 6 | - Eloquent 基础、模型对象关系、分页、搜索、排序。 7 | - 控制器、blade 模板。 8 | - Mail 操作。 9 | - Auth 类的使用。 10 | - Validator 类的使用。 11 | - 为求开发尽可能的简单高效,做出以下调整。 12 | - 所有控制器均置于顶层命名空间,遵循 PSR-0 规范,使用 PEAR 命名风格进行前后台控制器分离。 13 | - 开发阶段引入了 laravel-debugbar。 14 | - 开发阶段使用了自定义的辅助工具包 Assists,部署后可以完全移除。 15 | - 此项目仅用于学习交流,有任何问题请发 [issues](https://github.com/5-say/laravel-4.1-simple-blog/issues)。 16 | - 2014-02-19 初始版本编写结束。 17 | - 2014-09-09 为避免对新人产生错误引导,移除开发辅助工具(不规范),采用常规化的迁移与填充流程。 18 | 19 | --- 20 | 21 | - [项目进度](#project) 22 | - [安装方法](#install) 23 | - [变更项目数据库的方法](/change-db.md) 24 | - [项目截图](#screenshot) 25 | - [项目依赖](#require) 26 | - [开发者私人信息保密方法](#assume-unchanged) 27 | 28 | --- 29 | 30 | 31 | ### 项目进度 32 | 33 | - 已经完成 34 | - 权限 35 | - 注册、登录、邮箱激活、忘记密码 36 | - 最简陋的权限:仅区分管理员、注册用户、游客 37 | - 博客 38 | - 文章列表页 39 | - 分类文章列表页 40 | - 文章展示页 41 | - 评论 42 | - 管理员后台 43 | - 用户管理 44 | - 分类管理 45 | - 文章管理 46 | - Markdown 编辑器(编辑和发布文章) 47 | - 资源列表搜索功能 48 | - 资源列表排序功能 49 | - 用户中心 50 | - 修改密码 51 | - 更改头像 52 | - 我的评论 53 | - 预计加入的功能 54 | - 初始版本编写结束 55 | 56 | 57 | ### 安装方法 58 | 59 | [下载项目文件](https://github.com/5-say/laravel-4.1-simple-blog/archive/master.zip) 60 | 61 | 使用 composer 进行安装 62 | 63 | composer install 64 | 65 | > **注意:** 项目默认采用 Sqlite 数据库,数据库文件已包含于项目中。composer 安装结束后即可直接使用。 66 | > Assist 包中存放着迁移文件,可配合开发辅助工具无缝切换至 MySql 等 laravel 支持的数据库。(工具 URI `/5-say` ) 67 | 68 | 默认管理员账号密码: 69 | 70 | admin@demo.com 71 | 111111 72 | 73 | > 账号激活等功能需要进行邮件发送,请在 `/app/config/mail.php` 文件中做好邮件服务器的相关配置。 74 | 75 | 76 | ### 项目截图 77 | 78 | ![Alt text](/public/readmeAssets/mx3540D.png "Optional title") 79 | ![Alt text](/public/readmeAssets/mx3826D.png "Optional title") 80 | ![Alt text](/public/readmeAssets/mx3D2BE.png "Optional title") 81 | 82 | 83 | ### 项目依赖 84 | 85 | - 主要依赖 86 | - laravel/framework 87 | - 主框架 88 | - five-say/laravel-route-group 89 | - 对象化分组路由辅助 90 | - five-say/laravel-schema-extend 91 | - 默认结构生成器拓展(支持 MySql 表注释、列注释) 92 | - intervention/image 93 | - 图片处理 94 | - yzalis/identicon 95 | - 头像生成 96 | - michelf/php-markdown 97 | - markdown 文档解析 98 | - nickcernis/html-to-markdown 99 | - “html 文档”转“markdown 文档” 100 | - 开发辅助 101 | - barryvdh/laravel-debugbar 102 | - 调试工具栏 103 | 104 | 105 | ### 开发者私人信息保密方法 106 | 107 | 实际开发中(类似邮件功能)需要开发者私人密码的文件,可以采用以下方法进行隐私保护。**请在命令行中使用**。 108 | 109 | // 假设文件无改动,作用于版本库中已存在的文件。 110 | // 此方法将确保本地文件不提交,并且版本库中此文件的变更无法影响本地文件。 111 | git update-index --assume-unchanged app/config/mail.php 112 | // 取消并恢复为普通文件 113 | git update-index --no-assume-unchanged app/config/mail.php -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 |