├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── app ├── commands │ ├── .gitkeep │ └── DemoInstallCommand.php ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── local │ │ ├── app.php │ │ └── database.php │ ├── mail.php │ ├── packages │ │ ├── .gitkeep │ │ └── cartalyst │ │ │ └── sentinel │ │ │ └── config.php │ ├── queue.php │ ├── remote.php │ ├── services.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── AuthController.php │ ├── AuthorizedController.php │ ├── BaseController.php │ ├── HomeController.php │ ├── RolesController.php │ └── UsersController.php ├── database │ ├── .gitignore │ ├── migrations │ │ ├── .gitkeep │ │ └── 2014_08_07_185528_alter_persistences_table.php │ ├── production.sqlite │ └── seeds │ │ ├── .gitkeep │ │ ├── DatabaseSeeder.php │ │ └── UsersTableSeeder.php ├── filters.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── models │ └── Persistence.php ├── routes.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php └── views │ ├── emails │ └── auth │ │ └── reminder.blade.php │ ├── sentinel │ ├── account │ │ └── home.blade.php │ ├── emails │ │ ├── activate.blade.php │ │ └── reminder.blade.php │ ├── index.blade.php │ ├── login.blade.php │ ├── register.blade.php │ ├── reset │ │ ├── begin.blade.php │ │ └── complete.blade.php │ ├── roles │ │ ├── form.blade.php │ │ └── index.blade.php │ ├── swipe │ │ ├── register.blade.php │ │ └── sms │ │ │ ├── code.blade.php │ │ │ └── register.blade.php │ ├── users │ │ ├── form.blade.php │ │ └── index.blade.php │ └── wait.blade.php │ └── template.blade.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── composer.json ├── composer.lock ├── license.txt ├── phpunit.xml ├── public ├── .htaccess ├── assets │ ├── css │ │ ├── bootstrap.min.css │ │ ├── demo.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ └── js │ │ ├── bootstrap.min.js │ │ ├── cart.js │ │ └── jquery.min.js ├── favicon.ico ├── index.php ├── packages │ └── .gitkeep └── robots.txt ├── readme.md └── server.php /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | composer.lock 5 | .env.*.php 6 | .env.php 7 | .DS_Store 8 | Thumbs.db 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository! 4 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/commands/.gitkeep -------------------------------------------------------------------------------- /app/commands/DemoInstallCommand.php: -------------------------------------------------------------------------------- 1 | call('migrate:install', ['--force' => true]); 43 | } 44 | catch (Exception $e) { 45 | 46 | } 47 | 48 | $this->call('migrate:reset', ['--force' => true]); 49 | $this->call('migrate', ['--package' => 'cartalyst/sentinel', '--seed' => true, '--force' => true]); 50 | $this->call('migrate', ['--force' => true]); 51 | 52 | if (file_exists($path = $this->laravel['path.storage'].'/logs/laravel.log')) 53 | { 54 | @unlink($path); 55 | } 56 | } 57 | 58 | /** 59 | * Get the console command arguments. 60 | * 61 | * @return array 62 | */ 63 | protected function getArguments() 64 | { 65 | return array( 66 | 67 | ); 68 | } 69 | 70 | /** 71 | * Get the console command options. 72 | * 73 | * @return array 74 | */ 75 | protected function getOptions() 76 | { 77 | return array( 78 | 79 | ); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/config/app.php: -------------------------------------------------------------------------------- 1 | false, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => 'http://localhost', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'en', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Fallback Locale 60 | |-------------------------------------------------------------------------- 61 | | 62 | | The fallback locale determines the locale to use when the current one 63 | | is not available. You may change the value to correspond to any of 64 | | the language folders that are provided through your application. 65 | | 66 | */ 67 | 68 | 'fallback_locale' => 'en', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Encryption Key 73 | |-------------------------------------------------------------------------- 74 | | 75 | | This key is used by the Illuminate encrypter service and should be set 76 | | to a random, 32 character string, otherwise these encrypted strings 77 | | will not be safe. Please do this before deploying an application! 78 | | 79 | */ 80 | 81 | 'key' => 'YourSecretKey!!!', 82 | 83 | 'cipher' => MCRYPT_RIJNDAEL_128, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Autoloaded Service Providers 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The service providers listed here will be automatically loaded on the 91 | | request to your application. Feel free to add your own services to 92 | | this array to grant expanded functionality to your applications. 93 | | 94 | */ 95 | 96 | 'providers' => array( 97 | 98 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 99 | 'Illuminate\Auth\AuthServiceProvider', 100 | 'Illuminate\Cache\CacheServiceProvider', 101 | 'Illuminate\Session\CommandsServiceProvider', 102 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 103 | 'Illuminate\Routing\ControllerServiceProvider', 104 | 'Illuminate\Cookie\CookieServiceProvider', 105 | 'Illuminate\Database\DatabaseServiceProvider', 106 | 'Illuminate\Encryption\EncryptionServiceProvider', 107 | 'Illuminate\Filesystem\FilesystemServiceProvider', 108 | 'Illuminate\Hashing\HashServiceProvider', 109 | 'Illuminate\Html\HtmlServiceProvider', 110 | 'Illuminate\Log\LogServiceProvider', 111 | 'Illuminate\Mail\MailServiceProvider', 112 | 'Illuminate\Database\MigrationServiceProvider', 113 | 'Illuminate\Pagination\PaginationServiceProvider', 114 | 'Illuminate\Queue\QueueServiceProvider', 115 | 'Illuminate\Redis\RedisServiceProvider', 116 | 'Illuminate\Remote\RemoteServiceProvider', 117 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 118 | 'Illuminate\Database\SeedServiceProvider', 119 | 'Illuminate\Session\SessionServiceProvider', 120 | 'Illuminate\Translation\TranslationServiceProvider', 121 | 'Illuminate\Validation\ValidationServiceProvider', 122 | 'Illuminate\View\ViewServiceProvider', 123 | 'Illuminate\Workbench\WorkbenchServiceProvider', 124 | 125 | 'Cartalyst\Sentinel\Laravel\SentinelServiceProvider', 126 | 127 | ), 128 | 129 | /* 130 | |-------------------------------------------------------------------------- 131 | | Service Provider Manifest 132 | |-------------------------------------------------------------------------- 133 | | 134 | | The service provider manifest is used by Laravel to lazy load service 135 | | providers which are not needed for each request, as well to keep a 136 | | list of all of the services. Here, you may set its storage spot. 137 | | 138 | */ 139 | 140 | 'manifest' => storage_path().'/meta', 141 | 142 | /* 143 | |-------------------------------------------------------------------------- 144 | | Class Aliases 145 | |-------------------------------------------------------------------------- 146 | | 147 | | This array of class aliases will be registered when this application 148 | | is started. However, feel free to register as many as you wish as 149 | | the aliases are "lazy" loaded so they don't hinder performance. 150 | | 151 | */ 152 | 153 | 'aliases' => array( 154 | 155 | 'App' => 'Illuminate\Support\Facades\App', 156 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 157 | 'Auth' => 'Illuminate\Support\Facades\Auth', 158 | 'Blade' => 'Illuminate\Support\Facades\Blade', 159 | 'Cache' => 'Illuminate\Support\Facades\Cache', 160 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 161 | 'Config' => 'Illuminate\Support\Facades\Config', 162 | 'Controller' => 'Illuminate\Routing\Controller', 163 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 164 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 165 | 'DB' => 'Illuminate\Support\Facades\DB', 166 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 167 | 'Event' => 'Illuminate\Support\Facades\Event', 168 | 'File' => 'Illuminate\Support\Facades\File', 169 | 'Form' => 'Illuminate\Support\Facades\Form', 170 | 'Hash' => 'Illuminate\Support\Facades\Hash', 171 | 'HTML' => 'Illuminate\Support\Facades\HTML', 172 | 'Input' => 'Illuminate\Support\Facades\Input', 173 | 'Lang' => 'Illuminate\Support\Facades\Lang', 174 | 'Log' => 'Illuminate\Support\Facades\Log', 175 | 'Mail' => 'Illuminate\Support\Facades\Mail', 176 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 177 | 'Password' => 'Illuminate\Support\Facades\Password', 178 | 'Queue' => 'Illuminate\Support\Facades\Queue', 179 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 180 | 'Redis' => 'Illuminate\Support\Facades\Redis', 181 | 'Request' => 'Illuminate\Support\Facades\Request', 182 | 'Response' => 'Illuminate\Support\Facades\Response', 183 | 'Route' => 'Illuminate\Support\Facades\Route', 184 | 'Schema' => 'Illuminate\Support\Facades\Schema', 185 | 'Seeder' => 'Illuminate\Database\Seeder', 186 | 'Session' => 'Illuminate\Support\Facades\Session', 187 | 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', 188 | 'SSH' => 'Illuminate\Support\Facades\SSH', 189 | 'Str' => 'Illuminate\Support\Str', 190 | 'URL' => 'Illuminate\Support\Facades\URL', 191 | 'Validator' => 'Illuminate\Support\Facades\Validator', 192 | 'View' => 'Illuminate\Support\Facades\View', 193 | 'Activation' => 'Cartalyst\Sentinel\Laravel\Facades\Activation', 194 | 'Auth' => 'Cartalyst\Sentinel\Laravel\Facades\Sentinel', 195 | 'Reminder' => 'Cartalyst\Sentinel\Laravel\Facades\Reminder', 196 | 'Sentinel' => 'Cartalyst\Sentinel\Laravel\Facades\Sentinel', 197 | 198 | ), 199 | 200 | ); 201 | -------------------------------------------------------------------------------- /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' => 'emails.auth.reminder', 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' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'forge', 59 | 'username' => 'forge', 60 | 'password' => '', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'forge', 70 | 'username' => 'forge', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk haven't actually been run in the database. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => false, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/local/app.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | ); 19 | -------------------------------------------------------------------------------- /app/config/local/database.php: -------------------------------------------------------------------------------- 1 | array( 22 | 23 | 'mysql' => array( 24 | 'driver' => 'mysql', 25 | 'host' => 'localhost', 26 | 'database' => 'homestead', 27 | 'username' => 'homestead', 28 | 'password' => 'secret', 29 | 'charset' => 'utf8', 30 | 'collation' => 'utf8_unicode_ci', 31 | 'prefix' => '', 32 | ), 33 | 34 | 'pgsql' => array( 35 | 'driver' => 'pgsql', 36 | 'host' => 'localhost', 37 | 'database' => 'homestead', 38 | 'username' => 'homestead', 39 | 'password' => 'secret', 40 | 'charset' => 'utf8', 41 | 'prefix' => '', 42 | 'schema' => 'public', 43 | ), 44 | 45 | ), 46 | 47 | ); 48 | -------------------------------------------------------------------------------- /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 Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => 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' => true, 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/packages/cartalyst/sentinel/config.php: -------------------------------------------------------------------------------- 1 | 'cartalyst_sentinel', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Cookie Key 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Please provide your cookie key for Sentinel. 39 | | 40 | */ 41 | 42 | 'cookie' => 'cartalyst_sentinel', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Users 47 | |-------------------------------------------------------------------------- 48 | | 49 | | Please provide the user model used in Sentinel. 50 | | 51 | */ 52 | 53 | 'users' => [ 54 | 55 | 'model' => 'Cartalyst\Sentinel\Users\EloquentUser', 56 | 57 | ], 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Roles 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Please provide the role model used in Sentinel. 65 | | 66 | */ 67 | 68 | 'roles' => [ 69 | 70 | 'model' => 'Cartalyst\Sentinel\Roles\EloquentRole', 71 | 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Permissions 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Here you may specify the permissions class. Sentinel ships with two 80 | | permission types. 81 | | 82 | | 'Cartalyst\Sentinel\Permissions\SentinelPermissions' 83 | | 'Cartalyst\Sentinel\Permissions\StrictPermissions' 84 | | 85 | | "SentinelPermissions" will deny any permission as soon as it finds it 86 | | rejected on either the user or any of the assigned roles. 87 | | 88 | | "StrictPermissions" will assign a higher priority to the user 89 | | permissions over role permissions, once a user is allowed or denied 90 | | a specific permission, it will be used regardless of the 91 | | permissions set on the role. 92 | | 93 | */ 94 | 95 | 'permissions' => [ 96 | 97 | 'class' => 'Cartalyst\Sentinel\Permissions\StandardPermissions', 98 | 99 | ], 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Persistences 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Here you may specify the persistences model used and weather to use the 107 | | single persistence mode. 108 | | 109 | */ 110 | 111 | 'persistences' => [ 112 | 113 | 'model' => 'Persistence', 114 | 115 | 'single' => false, 116 | 117 | ], 118 | 119 | /* 120 | |-------------------------------------------------------------------------- 121 | | Checkpoints 122 | |-------------------------------------------------------------------------- 123 | | 124 | | When logging in, checking for existing sessions and failed logins occur, 125 | | you may configure an indefinite number of "checkpoints". These are 126 | | classes which may respond to each event and handle accordingly. 127 | | We ship with two, an activation checkpoint and a throttling 128 | | checkpoint. Feel free to add, remove or re-order 129 | | these. 130 | | 131 | */ 132 | 133 | 'checkpoints' => [ 134 | 'throttle', 135 | // 'activation', 136 | ], 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | Activations 141 | |-------------------------------------------------------------------------- 142 | | 143 | | Here you may specify the activations model used and the time (in seconds) 144 | | which activation codes expire. By default, activation codes expire after 145 | | three days. 146 | | 147 | */ 148 | 149 | 'activations' => [ 150 | 151 | 'model' => 'Cartalyst\Sentinel\Activations\EloquentActivation', 152 | 153 | 'expires' => 259200, 154 | 155 | 'lottery' => [2, 100], 156 | 157 | ], 158 | 159 | /* 160 | |-------------------------------------------------------------------------- 161 | | Reminders 162 | |-------------------------------------------------------------------------- 163 | | 164 | | Here you may specify the reminders model used and the time (in seconds) 165 | | which reminder codes expire. By default, reminder codes expire 166 | | after four hours. 167 | | 168 | */ 169 | 170 | 'reminders' => [ 171 | 172 | 'model' => 'Cartalyst\Sentinel\Reminders\EloquentReminder', 173 | 174 | 'expires' => 14400, 175 | 176 | 'lottery' => [2, 100], 177 | 178 | ], 179 | 180 | /* 181 | |-------------------------------------------------------------------------- 182 | | Throttling 183 | |-------------------------------------------------------------------------- 184 | | 185 | | Here, you may configure your site's throttling settings. There are three 186 | | types of throttling. 187 | | 188 | | The first type is "global". Global throttling will monitor the overall 189 | | failed login attempts across your site and can limit the effects of an 190 | | attempted DDoS attack. 191 | | 192 | | The second type is "ip". This allows you to throttle the failed login 193 | | attempts (across any account) of a given IP address. 194 | | 195 | | The third type is "user". This allows you to throttle the login attempts 196 | | on an individual user account. 197 | | 198 | | Each type of throttling has the same options. The first is the interval. 199 | | This is the time (in seconds) for which we check for failed logins. Any 200 | | logins outside this time are no longer assessed when throttling. 201 | | 202 | | The second option is thresholds. This may be approached one of two ways. 203 | | the first way, is by providing an key/value array. The key is the number 204 | | of failed login attempts, and the value is the delay, in seconds, before 205 | | the next attempt can occur. 206 | | 207 | | The second way is by providing an integer. If the number of failed login 208 | | attempts outweigh the thresholds integer, that throttle is locked until 209 | | there are no more failed login attempts within the specified interval. 210 | | 211 | | On this premise, we encourage you to use array thresholds for global 212 | | throttling (and perhaps IP throttling as well), so as to not lock your 213 | | whole site out for minutes on end because it's being DDoS'd. However, 214 | | for user throttling, locking a single account out because somebody is 215 | | attempting to breach it could be an appropriate response. 216 | | 217 | | You may use any type of throttling for any scenario, and the specific 218 | | configurations are designed to be customized as your site grows. 219 | | 220 | */ 221 | 222 | 'throttling' => [ 223 | 224 | 'model' => 'Cartalyst\Sentinel\Throttling\EloquentThrottle', 225 | 226 | 'global' => [ 227 | 228 | 'interval' => 900, 229 | 230 | 'thresholds' => [ 231 | 10 => 1000, 232 | 20 => 2000, 233 | 30 => 4000, 234 | 40 => 8000, 235 | 50 => 16000, 236 | 60 => 12000 237 | ], 238 | 239 | ], 240 | 241 | 'ip' => [ 242 | 243 | 'interval' => 900, 244 | 245 | 'thresholds' => 5, 246 | 247 | ], 248 | 249 | 'user' => [ 250 | 251 | 'interval' => 900, 252 | 253 | 'thresholds' => 5, 254 | 255 | ], 256 | 257 | ], 258 | 259 | ]; 260 | -------------------------------------------------------------------------------- /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 | 'ttr' => 60, 42 | ), 43 | 44 | 'sqs' => array( 45 | 'driver' => 'sqs', 46 | 'key' => 'your-public-key', 47 | 'secret' => 'your-secret-key', 48 | 'queue' => 'your-queue-url', 49 | 'region' => 'us-east-1', 50 | ), 51 | 52 | 'iron' => array( 53 | 'driver' => 'iron', 54 | 'host' => 'mq-aws-us-east-1.iron.io', 55 | 'token' => 'your-token', 56 | 'project' => 'your-project-id', 57 | 'queue' => 'your-queue-name', 58 | 'encrypt' => true, 59 | ), 60 | 61 | 'redis' => array( 62 | 'driver' => 'redis', 63 | 'queue' => 'default', 64 | ), 65 | 66 | ), 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Failed Queue Jobs 71 | |-------------------------------------------------------------------------- 72 | | 73 | | These options configure the behavior of failed queue job logging so you 74 | | can control which database and table are used to store the jobs that 75 | | have failed. You may change them to any database / table you wish. 76 | | 77 | */ 78 | 79 | 'failed' => array( 80 | 81 | 'database' => 'mysql', 'table' => 'failed_jobs', 82 | 83 | ), 84 | 85 | ); 86 | -------------------------------------------------------------------------------- /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 | ); 60 | -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | array( 18 | 'domain' => '', 19 | 'secret' => '', 20 | ), 21 | 22 | 'mandrill' => array( 23 | 'secret' => '', 24 | ), 25 | 26 | 'stripe' => array( 27 | 'model' => 'User', 28 | 'secret' => '', 29 | ), 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /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' => 'demo_sentinel_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 | ); 21 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /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 | ); 32 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | 'required|email', 31 | 'password' => 'required', 32 | ]; 33 | 34 | $validator = Validator::make($input, $rules); 35 | 36 | if ($validator->fails()) 37 | { 38 | return Redirect::back() 39 | ->withInput() 40 | ->withErrors($validator); 41 | } 42 | 43 | $remember = (bool) Input::get('remember', false); 44 | 45 | if (Sentinel::authenticate(Input::all(), $remember)) 46 | { 47 | return Redirect::intended('account'); 48 | } 49 | 50 | $errors = 'Invalid login or password.'; 51 | } 52 | catch (NotActivatedException $e) 53 | { 54 | $errors = 'Account is not activated!'; 55 | 56 | return Redirect::to('reactivate')->with('user', $e->getUser()); 57 | } 58 | catch (ThrottlingException $e) 59 | { 60 | $delay = $e->getDelay(); 61 | 62 | $errors = "Your account is blocked for {$delay} second(s)."; 63 | } 64 | 65 | return Redirect::back() 66 | ->withInput() 67 | ->withErrors($errors); 68 | } 69 | 70 | /** 71 | * Show the form for the user registration. 72 | * 73 | * @return \Illuminate\View\View 74 | */ 75 | public function register() 76 | { 77 | return View::make('sentinel.register'); 78 | } 79 | 80 | /** 81 | * Handle posting of the form for the user registration. 82 | * 83 | * @return \Illuminate\Http\RedirectResponse 84 | */ 85 | public function processRegistration() 86 | { 87 | $input = Input::all(); 88 | 89 | $rules = [ 90 | 'email' => 'required|email|unique:users', 91 | 'password' => 'required', 92 | 'password_confirm' => 'required|same:password', 93 | ]; 94 | 95 | $validator = Validator::make($input, $rules); 96 | 97 | if ($validator->fails()) 98 | { 99 | return Redirect::back() 100 | ->withInput() 101 | ->withErrors($validator); 102 | } 103 | 104 | if ($user = Sentinel::register($input)) 105 | { 106 | $activation = Activation::create($user); 107 | 108 | $code = $activation->code; 109 | 110 | $sent = Mail::send('sentinel.emails.activate', compact('user', 'code'), function($m) use ($user) 111 | { 112 | $m->to($user->email)->subject('Activate Your Account'); 113 | }); 114 | 115 | if ($sent === 0) 116 | { 117 | return Redirect::to('register') 118 | ->withErrors('Failed to send activation email.'); 119 | } 120 | 121 | return Redirect::to('login') 122 | ->withSuccess('Your accout was successfully created. You might login now.') 123 | ->with('userId', $user->getUserId()); 124 | } 125 | 126 | return Redirect::to('register') 127 | ->withInput() 128 | ->withErrors('Failed to register.'); 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /app/controllers/AuthorizedController.php: -------------------------------------------------------------------------------- 1 | beforeFilter('auth'); 8 | 9 | $this->user = Sentinel::getUser(); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | roles = Sentinel::getRoleRepository()->createModel(); 22 | } 23 | 24 | /** 25 | * Display a listing of roles. 26 | * 27 | * @return \Illuminate\View\View 28 | */ 29 | public function index() 30 | { 31 | $roles = $this->roles->paginate(); 32 | 33 | return View::make('sentinel.roles.index', compact('roles')); 34 | } 35 | 36 | /** 37 | * Show the form for creating new role. 38 | * 39 | * @return \Illuminate\View\View 40 | */ 41 | public function create() 42 | { 43 | return $this->showForm('create'); 44 | } 45 | 46 | /** 47 | * Handle posting of the form for creating new role. 48 | * 49 | * @return \Illuminate\Http\RedirectResponse 50 | */ 51 | public function store() 52 | { 53 | return $this->processForm('create'); 54 | } 55 | 56 | /** 57 | * Show the form for updating role. 58 | * 59 | * @param int $id 60 | * @return mixed 61 | */ 62 | public function edit($id) 63 | { 64 | return $this->showForm('update', $id); 65 | } 66 | 67 | /** 68 | * Handle posting of the form for updating role. 69 | * 70 | * @param int $id 71 | * @return \Illuminate\Http\RedirectResponse 72 | */ 73 | public function update($id) 74 | { 75 | return $this->processForm('update', $id); 76 | } 77 | 78 | /** 79 | * Remove the specified role. 80 | * 81 | * @param int $id 82 | * @return \Illuminate\Http\RedirectResponse 83 | */ 84 | public function delete($id) 85 | { 86 | if ($role = $this->roles->find($id)) 87 | { 88 | $role->delete(); 89 | 90 | return Redirect::to('roles'); 91 | } 92 | 93 | return Redirect::to('roles'); 94 | } 95 | 96 | /** 97 | * Shows the form. 98 | * 99 | * @param string $mode 100 | * @param int $id 101 | * @return mixed 102 | */ 103 | protected function showForm($mode, $id = null) 104 | { 105 | if ($id) 106 | { 107 | if ( ! $role = $this->roles->find($id)) 108 | { 109 | return Redirect::to('roles'); 110 | } 111 | } 112 | else 113 | { 114 | $role = $this->roles; 115 | } 116 | 117 | return View::make('sentinel.roles.form', compact('mode', 'role')); 118 | } 119 | 120 | /** 121 | * Processes the form. 122 | * 123 | * @param string $mode 124 | * @param int $id 125 | * @return \Illuminate\Http\RedirectResponse 126 | */ 127 | protected function processForm($mode, $id = null) 128 | { 129 | $input = Input::all(); 130 | 131 | $rules = [ 132 | 'name' => 'required', 133 | 'slug' => 'required|unique:roles' 134 | ]; 135 | 136 | if ($id) 137 | { 138 | $role = $this->roles->find($id); 139 | 140 | $rules['slug'] .= ",slug,{$role->slug},slug"; 141 | 142 | $messages = $this->validateRole($input, $rules); 143 | 144 | if ($messages->isEmpty()) 145 | { 146 | $role->fill($input); 147 | 148 | $role->save(); 149 | } 150 | } 151 | else 152 | { 153 | $messages = $this->validateRole($input, $rules); 154 | 155 | if ($messages->isEmpty()) 156 | { 157 | $role = $this->roles->create($input); 158 | } 159 | } 160 | 161 | if ($messages->isEmpty()) 162 | { 163 | return Redirect::to('roles'); 164 | } 165 | 166 | return Redirect::back()->withInput()->withErrors($messages); 167 | } 168 | 169 | /** 170 | * Validates a role. 171 | * 172 | * @param array $data 173 | * @param mixed $id 174 | * @return \Illuminate\Support\MessageBag 175 | */ 176 | protected function validateRole($data, $rules) 177 | { 178 | $validator = Validator::make($data, $rules); 179 | 180 | $validator->passes(); 181 | 182 | return $validator->errors(); 183 | } 184 | 185 | } 186 | -------------------------------------------------------------------------------- /app/controllers/UsersController.php: -------------------------------------------------------------------------------- 1 | users = Sentinel::getUserRepository(); 22 | } 23 | 24 | /** 25 | * Display a listing of users. 26 | * 27 | * @return \Illuminate\View\View 28 | */ 29 | public function index() 30 | { 31 | $users = $this->users->createModel()->paginate(); 32 | 33 | return View::make('sentinel.users.index', compact('users')); 34 | } 35 | 36 | /** 37 | * Show the form for creating new user. 38 | * 39 | * @return \Illuminate\View\View 40 | */ 41 | public function create() 42 | { 43 | return $this->showForm('create'); 44 | } 45 | 46 | /** 47 | * Handle posting of the form for creating new user. 48 | * 49 | * @return \Illuminate\Http\RedirectResponse 50 | */ 51 | public function store() 52 | { 53 | return $this->processForm('create'); 54 | } 55 | 56 | /** 57 | * Show the form for updating user. 58 | * 59 | * @param int $id 60 | * @return mixed 61 | */ 62 | public function edit($id) 63 | { 64 | return $this->showForm('update', $id); 65 | } 66 | 67 | /** 68 | * Handle posting of the form for updating user. 69 | * 70 | * @param int $id 71 | * @return \Illuminate\Http\RedirectResponse 72 | */ 73 | public function update($id) 74 | { 75 | return $this->processForm('update', $id); 76 | } 77 | 78 | /** 79 | * Remove the specified user. 80 | * 81 | * @param int $id 82 | * @return \Illuminate\Http\RedirectResponse 83 | */ 84 | public function delete($id) 85 | { 86 | if ($user = $this->users->createModel()->find($id)) 87 | { 88 | $user->delete(); 89 | 90 | return Redirect::to('users'); 91 | } 92 | 93 | return Redirect::to('users'); 94 | } 95 | 96 | /** 97 | * Shows the form. 98 | * 99 | * @param string $mode 100 | * @param int $id 101 | * @return mixed 102 | */ 103 | protected function showForm($mode, $id = null) 104 | { 105 | if ($id) 106 | { 107 | if ( ! $user = $this->users->createModel()->find($id)) 108 | { 109 | return Redirect::to('users'); 110 | } 111 | } 112 | else 113 | { 114 | $user = $this->users->createModel(); 115 | } 116 | 117 | return View::make('sentinel.users.form', compact('mode', 'user')); 118 | } 119 | 120 | /** 121 | * Processes the form. 122 | * 123 | * @param string $mode 124 | * @param int $id 125 | * @return \Illuminate\Http\RedirectResponse 126 | */ 127 | protected function processForm($mode, $id = null) 128 | { 129 | $input = array_filter(Input::all()); 130 | 131 | $rules = [ 132 | 'first_name' => 'required', 133 | 'last_name' => 'required', 134 | 'email' => 'required|unique:users' 135 | ]; 136 | 137 | if ($id) 138 | { 139 | $user = $this->users->createModel()->find($id); 140 | 141 | $rules['email'] .= ",email,{$user->email},email"; 142 | 143 | $messages = $this->validateUser($input, $rules); 144 | 145 | if ($messages->isEmpty()) 146 | { 147 | $this->users->update($user, $input); 148 | } 149 | } 150 | else 151 | { 152 | $messages = $this->validateUser($input, $rules); 153 | 154 | if ($messages->isEmpty()) 155 | { 156 | $user = $this->users->create($input); 157 | 158 | $code = Activation::create($user); 159 | 160 | Activation::complete($user, $code); 161 | } 162 | } 163 | 164 | if ($messages->isEmpty()) 165 | { 166 | return Redirect::to('users'); 167 | } 168 | 169 | return Redirect::back()->withInput()->withErrors($messages); 170 | } 171 | 172 | /** 173 | * Validates a user. 174 | * 175 | * @param array $data 176 | * @param mixed $id 177 | * @return \Illuminate\Support\MessageBag 178 | */ 179 | protected function validateUser($data, $rules) 180 | { 181 | $validator = Validator::make($data, $rules); 182 | 183 | $validator->passes(); 184 | 185 | return $validator->errors(); 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /app/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/database/migrations/.gitkeep -------------------------------------------------------------------------------- /app/database/migrations/2014_08_07_185528_alter_persistences_table.php: -------------------------------------------------------------------------------- 1 | string('version')->nullable()->after('code'); 18 | $table->string('browser')->nullable()->after('version'); 19 | $table->string('platform')->nullable()->after('browser'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('persistences', function(Blueprint $table) 31 | { 32 | $table->dropColumn('version'); 33 | $table->dropColumn('browser'); 34 | $table->dropColumn('platform'); 35 | }); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/database/production.sqlite -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/app/database/seeds/.gitkeep -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UsersTableSeeder'); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 8 | DB::table('roles')->truncate(); 9 | DB::table('role_users')->truncate(); 10 | 11 | $role = [ 12 | 'name' => 'Administrator', 13 | 'slug' => 'administrator', 14 | 'permissions' => [ 15 | 'admin' => true, 16 | ] 17 | ]; 18 | 19 | $adminRole = Sentinel::getRoleRepository()->createModel()->fill($role)->save(); 20 | 21 | $subscribersRole = [ 22 | 'name' => 'Subscribers', 23 | 'slug' => 'subscribers', 24 | ]; 25 | 26 | Sentinel::getRoleRepository()->createModel()->fill($subscribersRole)->save(); 27 | 28 | $admin = [ 29 | 'email' => 'admin@example.com', 30 | 'password' => 'password', 31 | ]; 32 | 33 | $users = [ 34 | 35 | [ 36 | 'email' => 'demo1@example.com', 37 | 'password' => 'demo123', 38 | ], 39 | 40 | [ 41 | 'email' => 'demo2@example.com', 42 | 'password' => 'demo123', 43 | ], 44 | 45 | [ 46 | 'email' => 'demo3@example.com', 47 | 'password' => 'demo123', 48 | ], 49 | 50 | ]; 51 | 52 | $adminUser = Sentinel::registerAndActivate($admin); 53 | $adminUser->roles()->attach($adminRole); 54 | 55 | foreach ($users as $user) 56 | { 57 | Sentinel::registerAndActivate($user); 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | withErrors(['Only admins can access this page.']); 56 | } 57 | }); 58 | 59 | Route::filter('auth.basic', function() 60 | { 61 | return Auth::basic(); 62 | }); 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Guest Filter 67 | |-------------------------------------------------------------------------- 68 | | 69 | | The "guest" filter is the counterpart of the authentication filters as 70 | | it simply checks that the current user is not logged in. A redirect 71 | | response will be issued if they are, which you may freely change. 72 | | 73 | */ 74 | 75 | Route::filter('guest', function() 76 | { 77 | if (Auth::check()) return Redirect::to('/'); 78 | }); 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | CSRF Protection Filter 83 | |-------------------------------------------------------------------------- 84 | | 85 | | The CSRF filter is responsible for protecting your application against 86 | | cross-site request forgery attacks. If this special token in a user 87 | | session does not match the one given in this request, we'll bail. 88 | | 89 | */ 90 | 91 | Route::filter('csrf', function() 92 | { 93 | if (Session::token() != Input::get('_token')) 94 | { 95 | throw new Illuminate\Session\TokenMismatchException; 96 | } 97 | }); 98 | -------------------------------------------------------------------------------- /app/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /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/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => array( 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ), 30 | "boolean" => "The :attribute field must be true or false", 31 | "confirmed" => "The :attribute confirmation does not match.", 32 | "date" => "The :attribute is not a valid date.", 33 | "date_format" => "The :attribute does not match the format :format.", 34 | "different" => "The :attribute and :other must be different.", 35 | "digits" => "The :attribute must be :digits digits.", 36 | "digits_between" => "The :attribute must be between :min and :max digits.", 37 | "email" => "The :attribute must be a valid email address.", 38 | "exists" => "The selected :attribute is invalid.", 39 | "image" => "The :attribute must be an image.", 40 | "in" => "The selected :attribute is invalid.", 41 | "integer" => "The :attribute must be an integer.", 42 | "ip" => "The :attribute must be a valid IP address.", 43 | "max" => array( 44 | "numeric" => "The :attribute may not be greater than :max.", 45 | "file" => "The :attribute may not be greater than :max kilobytes.", 46 | "string" => "The :attribute may not be greater than :max characters.", 47 | "array" => "The :attribute may not have more than :max items.", 48 | ), 49 | "mimes" => "The :attribute must be a file of type: :values.", 50 | "min" => array( 51 | "numeric" => "The :attribute must be at least :min.", 52 | "file" => "The :attribute must be at least :min kilobytes.", 53 | "string" => "The :attribute must be at least :min characters.", 54 | "array" => "The :attribute must have at least :min items.", 55 | ), 56 | "not_in" => "The selected :attribute is invalid.", 57 | "numeric" => "The :attribute must be a number.", 58 | "regex" => "The :attribute format is invalid.", 59 | "required" => "The :attribute field is required.", 60 | "required_if" => "The :attribute field is required when :other is :value.", 61 | "required_with" => "The :attribute field is required when :values is present.", 62 | "required_with_all" => "The :attribute field is required when :values is present.", 63 | "required_without" => "The :attribute field is required when :values is not present.", 64 | "required_without_all" => "The :attribute field is required when none of :values are present.", 65 | "same" => "The :attribute and :other must match.", 66 | "size" => array( 67 | "numeric" => "The :attribute must be :size.", 68 | "file" => "The :attribute must be :size kilobytes.", 69 | "string" => "The :attribute must be :size characters.", 70 | "array" => "The :attribute must contain :size items.", 71 | ), 72 | "unique" => "The :attribute has already been taken.", 73 | "url" => "The :attribute format is invalid.", 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Custom Validation Language Lines 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Here you may specify custom validation messages for attributes using the 81 | | convention "attribute.rule" to name the lines. This makes it quick to 82 | | specify a specific custom language line for a given attribute rule. 83 | | 84 | */ 85 | 86 | 'custom' => array( 87 | 'attribute-name' => array( 88 | 'rule-name' => 'custom-message', 89 | ), 90 | ), 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | Custom Validation Attributes 95 | |-------------------------------------------------------------------------- 96 | | 97 | | The following language lines are used to swap attribute place-holders 98 | | with something more reader friendly such as E-Mail Address instead 99 | | of "email". This simply helps us make messages a little cleaner. 100 | | 101 | */ 102 | 103 | 'attributes' => array(), 104 | 105 | ); 106 | -------------------------------------------------------------------------------- /app/models/Persistence.php: -------------------------------------------------------------------------------- 1 | getVersion(); 27 | $attributes['platform'] = $browser->getPlatform(); 28 | $attributes['browser'] = $browser->getBrowser(); 29 | 30 | parent::__construct($attributes); 31 | } 32 | 33 | /** 34 | * Last used accessor. 35 | * 36 | * @param mixed $value 37 | * @return string 38 | */ 39 | public function getLastUsedAttribute($value) 40 | { 41 | $lastUsed = $this->updated_at; 42 | 43 | $diff = $lastUsed->diffInMinutes(); 44 | 45 | switch ($diff) 46 | { 47 | case 0: 48 | $value = 'now.'; 49 | break; 50 | 51 | case $diff > 60 && $diff <= 1440: 52 | $value = $lastUsed->diffInHours() . ' hours ago.'; 53 | break; 54 | 55 | case $diff <= 60: 56 | $value = $lastUsed->diffInMinutes() . ' mintues ago.'; 57 | break; 58 | 59 | case $diff > 1440 && $diff < 44640: 60 | $value = $lastUsed->diffInDays() . ' days ago.'; 61 | break; 62 | 63 | case $diff >= 44640 && $diff < 525949: 64 | $value = $lastUsed->diffInMonths() . ' months ago.'; 65 | break; 66 | 67 | case $diff > 525949: 68 | $value = $lastUsed->diffInYears() . ' years ago.'; 69 | break; 70 | 71 | default: 72 | $value = $lastUsed->diffInSeconds() . ' seconds ago.'; 73 | break; 74 | } 75 | 76 | return $value; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /app/routes.php: -------------------------------------------------------------------------------- 1 | 'auth.admin', 'prefix' => 'roles'], function() 14 | { 15 | Route::get('/', 'RolesController@index'); 16 | Route::get('create', 'RolesController@create'); 17 | Route::post('create', 'RolesController@store'); 18 | Route::get('{id}', 'RolesController@edit'); 19 | Route::post('{id}', 'RolesController@update'); 20 | Route::get('{id}/delete', 'RolesController@delete'); 21 | }); 22 | 23 | Route::group(['before' => 'auth.admin', 'prefix' => 'users'], function() 24 | { 25 | Route::get('/', 'UsersController@index'); 26 | Route::get('create', 'UsersController@create'); 27 | Route::post('create', 'UsersController@store'); 28 | Route::get('{id}', 'UsersController@edit'); 29 | Route::post('{id}', 'UsersController@update'); 30 | Route::get('{id}/delete', 'UsersController@delete'); 31 | }); 32 | 33 | Route::get('/', function() 34 | { 35 | if (Sentinel::check()) 36 | { 37 | return Redirect::to('account'); 38 | } 39 | 40 | return View::make('sentinel.index'); 41 | }); 42 | 43 | Route::get('login', 'AuthController@login'); 44 | Route::post('login', 'AuthController@processLogin'); 45 | 46 | Route::get('register', 'AuthController@register'); 47 | Route::post('register', 'AuthController@processRegistration'); 48 | 49 | Route::get('wait', function() 50 | { 51 | return View::make('sentinel.wait'); 52 | }); 53 | 54 | Route::get('activate/{id}/{code}', function($id, $code) 55 | { 56 | $user = Sentinel::findById($id); 57 | 58 | if ( ! Activation::complete($user, $code)) 59 | { 60 | return Redirect::to("login") 61 | ->withErrors('Invalid or expired activation code.'); 62 | } 63 | 64 | return Redirect::to('login') 65 | ->withSuccess('Account activated.'); 66 | })->where('id', '\d+'); 67 | 68 | Route::get('reactivate', function() 69 | { 70 | if ( ! $user = Sentinel::check()) 71 | { 72 | return Redirect::to('login'); 73 | } 74 | 75 | $activation = Activation::exists($user) ?: Activation::create($user); 76 | 77 | // This is used for the demo, usually you would want 78 | // to activate the account through the link you 79 | // receive in the activation email 80 | Activation::complete($user, $activation->code); 81 | 82 | // $code = $activation->code; 83 | 84 | // $sent = Mail::send('sentinel.emails.activate', compact('user', 'code'), function($m) use ($user) 85 | // { 86 | // $m->to($user->email)->subject('Activate Your Account'); 87 | // }); 88 | 89 | // if ($sent === 0) 90 | // { 91 | // return Redirect::to('register') 92 | // ->withErrors('Failed to send activation email.'); 93 | // } 94 | 95 | return Redirect::to('account') 96 | ->withSuccess('Account activated.'); 97 | })->where('id', '\d+'); 98 | 99 | Route::get('deactivate', function() 100 | { 101 | $user = Sentinel::check(); 102 | 103 | Activation::remove($user); 104 | 105 | return Redirect::back() 106 | ->withSuccess('Account deactivated.'); 107 | }); 108 | 109 | Route::get('reset', function() 110 | { 111 | return View::make('sentinel.reset.begin'); 112 | }); 113 | 114 | Route::post('reset', function() 115 | { 116 | $rules = [ 117 | 'email' => 'required|email', 118 | ]; 119 | 120 | $validator = Validator::make(Input::get(), $rules); 121 | 122 | if ($validator->fails()) 123 | { 124 | return Redirect::back() 125 | ->withInput() 126 | ->withErrors($validator); 127 | } 128 | 129 | $email = Input::get('email'); 130 | 131 | $user = Sentinel::findByCredentials(compact('email')); 132 | 133 | if ( ! $user) 134 | { 135 | return Redirect::back() 136 | ->withInput() 137 | ->withErrors('No user with that email address belongs in our system.'); 138 | } 139 | 140 | // $reminder = Reminder::exists($user) ?: Reminder::create($user); 141 | 142 | // $code = $reminder->code; 143 | 144 | // $sent = Mail::send('sentinel.emails.reminder', compact('user', 'code'), function($m) use ($user) 145 | // { 146 | // $m->to($user->email)->subject('Reset your account password.'); 147 | // }); 148 | 149 | // if ($sent === 0) 150 | // { 151 | // return Redirect::to('register') 152 | // ->withErrors('Failed to send reset password email.'); 153 | // } 154 | 155 | return Redirect::to('wait'); 156 | }); 157 | 158 | Route::get('reset/{id}/{code}', function($id, $code) 159 | { 160 | $user = Sentinel::findById($id); 161 | 162 | return View::make('sentinel.reset.complete'); 163 | 164 | })->where('id', '\d+'); 165 | 166 | Route::post('reset/{id}/{code}', function($id, $code) 167 | { 168 | $rules = [ 169 | 'password' => 'required|confirmed', 170 | ]; 171 | 172 | $validator = Validator::make(Input::get(), $rules); 173 | 174 | if ($validator->fails()) 175 | { 176 | return Redirect::back() 177 | ->withInput() 178 | ->withErrors($validator); 179 | } 180 | 181 | $user = Sentinel::findById($id); 182 | 183 | if ( ! $user) 184 | { 185 | return Redirect::back() 186 | ->withInput() 187 | ->withErrors('The user no longer exists.'); 188 | } 189 | 190 | if ( ! Reminder::complete($user, $code, Input::get('password'))) 191 | { 192 | return Redirect::to('login') 193 | ->withErrors('Invalid or expired reset code.'); 194 | } 195 | 196 | return Redirect::to('login') 197 | ->withSuccess("Password Reset."); 198 | })->where('id', '\d+'); 199 | 200 | Route::group(['prefix' => 'account', 'before' => 'auth'], function() 201 | { 202 | 203 | Route::get('/', function() 204 | { 205 | $user = Sentinel::getUser(); 206 | 207 | $persistence = Sentinel::getPersistenceRepository(); 208 | 209 | return View::make('sentinel.account.home', compact('user', 'persistence')); 210 | }); 211 | 212 | Route::get('kill', function() 213 | { 214 | $user = Sentinel::getUser(); 215 | 216 | Sentinel::getPersistenceRepository()->flush($user); 217 | 218 | return Redirect::back(); 219 | }); 220 | 221 | Route::get('kill-all', function() 222 | { 223 | $user = Sentinel::getUser(); 224 | 225 | Sentinel::getPersistenceRepository()->flush($user, false); 226 | 227 | return Redirect::back(); 228 | }); 229 | 230 | Route::get('kill/{code}', function($code) 231 | { 232 | Sentinel::getPersistenceRepository()->remove($code); 233 | 234 | return Redirect::back(); 235 | }); 236 | 237 | }); 238 | -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | withErrors($exception->getMessage()); 53 | }); 54 | 55 | App::error(function(Cartalyst\Sentinel\Checkpoints\ThrottlingException $exception, $code) 56 | { 57 | $free = $exception->getFree()->format('d M, h:i:s a'); 58 | 59 | switch ($exception->getType()) 60 | { 61 | case 'global': 62 | $message = "Our site appears to be spammed. To give eveything a chance to calm down, please try again after {$free}."; 63 | break; 64 | 65 | case 'ip': 66 | $message = "Too many unauthorized attemps have been made against your IP address. Please wait until {$free} before trying again."; 67 | break; 68 | 69 | case 'user': 70 | $message = "Too many unauthorized attemps have been made against your account. For your security, your account is locked until {$free}."; 71 | break; 72 | } 73 | 74 | return Redirect::to('login') 75 | ->withErrors($message); 76 | }); 77 | 78 | App::error(function(Exception $exception, $code) 79 | { 80 | Log::error($exception); 81 | }); 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Maintenance Mode Handler 86 | |-------------------------------------------------------------------------- 87 | | 88 | | The "down" Artisan command gives you the ability to put an application 89 | | into maintenance mode. Here, you will define what is displayed back 90 | | to the user if maintenance mode is in effect for the application. 91 | | 92 | */ 93 | 94 | App::down(function() 95 | { 96 | return Response::make("Be right back!", 503); 97 | }); 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Require The Filters File 102 | |-------------------------------------------------------------------------- 103 | | 104 | | Next we will load the filters file for the application. This gives us 105 | | a nice separate location to store our route and application filter 106 | | definitions instead of putting them all in the main routes file. 107 | | 108 | */ 109 | 110 | require app_path().'/filters.php'; 111 | -------------------------------------------------------------------------------- /app/start/local.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
11 | This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes. 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/sentinel/account/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | My Account 5 | @stop 6 | 7 | @section('body') 8 | 9 | 12 | 13 |
14 |
15 |

16 | My Logged In Sessions 17 | Click to Kill 18 |

19 | 20 | 24 | 25 | 44 | 45 |
46 | 47 |
48 |

Activation

49 | 50 | @if (Activation::completed($user)) 51 | 52 | Deactivate 53 | 54 | @else 55 | 56 | Activate 57 | 58 | @endif 59 |
60 | 61 | 62 | @stop 63 | -------------------------------------------------------------------------------- /app/views/sentinel/emails/activate.blade.php: -------------------------------------------------------------------------------- 1 | Activate your account by clicking getUserId()}/{$code}") }}">here 2 | -------------------------------------------------------------------------------- /app/views/sentinel/emails/reminder.blade.php: -------------------------------------------------------------------------------- 1 | Reset your password by clicking getUserId()}/{$code}") }}">here 2 | -------------------------------------------------------------------------------- /app/views/sentinel/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('body') 4 | 5 | 16 | 17 | @stop 18 | -------------------------------------------------------------------------------- /app/views/sentinel/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Login 5 | @stop 6 | 7 | @section('body') 8 | 9 | 12 | 13 |
14 |
15 | 16 |
17 |

Demo Users

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
EmailPassword
admin@example.compassword
demo1@example.comdemo123
demo2@example.comdemo123
demo3@example.comdemo123
45 |
46 |
47 |
48 | 49 | {{ Form::open(array('class' => 'form-horizontal', 'autocomplete' => 'off')) }} 50 | 51 |
52 | 53 |
54 | {{ Form::email('email', null, array('class' => 'form-control')) }} 55 |

{{ $errors->first('email') }}

56 |
57 |
58 | 59 |
60 | 61 |
62 | {{ Form::password('password', array('class' => 'form-control')) }} 63 |

{{ $errors->first('password') }}

64 |
65 |
66 | 67 |
68 |
69 | 73 |
74 |
75 | 76 |
77 |
78 | {{ Form::submit('Login', array('class' => 'btn btn-primary')) }} 79 | {{ Form::reset('Reset', array('class' => 'btn btn-default')) }} 80 | Forgot password? 81 |
82 |
83 | 84 | {{ Form::close() }} 85 | 86 | @stop 87 | -------------------------------------------------------------------------------- /app/views/sentinel/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Register 5 | @stop 6 | 7 | @section('body') 8 | 9 | 12 | 13 | {{ Form::open(array('class' => 'form-horizontal')) }} 14 | 15 |
16 | 17 |
18 | {{ Form::email('email', null, array('class' => 'form-control')) }} 19 |

{{ $errors->first('email') }}

20 |
21 |
22 | 23 |
24 | 25 |
26 | {{ Form::password('password', array('class' => 'form-control')) }} 27 |

{{ $errors->first('password') }}

28 |
29 |
30 | 31 |
32 | 33 |
34 | {{ Form::password('password_confirm', array('class' => 'form-control')) }} 35 |

{{ $errors->first('password_confirm') }}

36 |
37 |
38 | 39 |
40 |
41 | {{ Form::submit('Register', array('class' => 'btn btn-primary')) }} 42 | {{ Form::reset('Reset', array('class' => 'btn btn-default')) }} 43 |
44 |
45 | 46 | {{ Form::close() }} 47 | 48 | @stop 49 | -------------------------------------------------------------------------------- /app/views/sentinel/reset/begin.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Reset Password 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 | {{ Form::open(['class' => 'form-horizontal']) }} 16 | 17 |
18 | 19 |
20 | {{ Form::email('email', null, ['class' => 'form-control']) }} 21 |
22 |
23 | 24 |
25 |
26 | {{ Form::submit('Reset', ['class' => 'btn btn-lg btn-primary']) }} 27 |
28 |
29 | 30 | {{ Form::close() }} 31 |
32 | 33 | @stop 34 | -------------------------------------------------------------------------------- /app/views/sentinel/reset/complete.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Reset Password 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 | {{ Form::open(['class' => 'form-horizontal']) }} 16 | 17 |
18 | 19 |
20 | {{ Form::password('password', ['class' => 'form-control']) }} 21 |
22 |
23 | 24 |
25 | 26 |
27 | {{ Form::password('password_confirmation', ['class' => 'form-control']) }} 28 |
29 |
30 | 31 |
32 |
33 | {{ Form::submit('Reset', ['class' => 'btn btn-lg btn-primary']) }} 34 |
35 |
36 | 37 | {{ Form::close() }} 38 |
39 | 40 | @stop 41 | -------------------------------------------------------------------------------- /app/views/sentinel/roles/form.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | {{-- Page content --}} 4 | @section('body') 5 | 6 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | {{{ $errors->first('name', ':message') }}} 19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | {{{ $errors->first('slug', ':message') }}} 29 | 30 |
31 | 32 | 33 | 34 |
35 | 36 | @stop 37 | -------------------------------------------------------------------------------- /app/views/sentinel/roles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | {{-- Page content --}} 4 | @section('body') 5 | 6 | 9 | 10 | @if ($roles->count()) 11 | Page {{ $roles->getCurrentPage() }} of {{ $roles->getLastPage() }} 12 | 13 |
14 | {{ $roles->links() }} 15 |
16 | 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach ($roles as $role) 27 | 28 | 29 | 30 | 34 | 35 | @endforeach 36 | 37 |
NameSlugActions
{{ $role->name }}{{ $role->slug }} 31 | id}") }}">Edit 32 | id}/delete") }}">Delete 33 |
38 | 39 | Page {{ $roles->getCurrentPage() }} of {{ $roles->getLastPage() }} 40 | 41 |
42 | {{ $roles->links() }} 43 |
44 | @else 45 |
46 | 47 | Nothing to show here. 48 | 49 |
50 | @endif 51 | 52 | @stop 53 | -------------------------------------------------------------------------------- /app/views/sentinel/swipe/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Register for Swipe 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 |

Please download the Swift Identity app on your compatible device. When opened, login with the following one-time credentials. Once you have logged in, press continue.

16 | 17 |

If you are already logged into Swift Identity with the below details on your device, just press continue.

18 | 19 |
20 |
Login
21 |
{{ $login }}
22 |
Password
23 |
{{ $code }}
24 |
25 | 26 |

27 | Continue 28 |

29 | 30 |
31 | 32 | @stop 33 | -------------------------------------------------------------------------------- /app/views/sentinel/swipe/sms/code.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Enter SMS Code 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 |

Please enter the SMS code you received. If you don't receive a code in the next couple of minutes, please try again.

16 | 17 | {{ Form::open(['class' => 'form-horizontal']) }} 18 | 19 |
20 | 21 |
22 | {{ Form::text('code', null, ['class' => 'form-control']) }} 23 |
24 |
25 | 26 |
27 |
28 | {{ Form::submit('Continue', ['class' => 'btn btn-lg btn-primary']) }} 29 | {{ Form::reset('Reset', ['class' => 'btn btn-default']) }} 30 |
31 |
32 | 33 | {{ Form::close() }} 34 | 35 |
36 | 37 | @stop 38 | -------------------------------------------------------------------------------- /app/views/sentinel/swipe/sms/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Register for SMS 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 |

Please enter your number (with country code). No spaces allowed.

16 | 17 | {{ Form::open(['class' => 'form-horizontal']) }} 18 | 19 |
20 | 21 |
22 | {{ Form::text('number', null, ['class' => 'form-control']) }} 23 |
24 |
25 | 26 |
27 | 28 |
29 | {{ Form::text('number_confirmation', null, ['class' => 'form-control']) }} 30 |
31 |
32 | 33 |
34 |
35 | {{ Form::submit('Register', ['class' => 'btn btn-lg btn-primary']) }} 36 | {{ Form::reset('Reset', ['class' => 'btn btn-default']) }} 37 |
38 |
39 | 40 | {{ Form::close() }} 41 | 42 |
43 | 44 | @stop 45 | -------------------------------------------------------------------------------- /app/views/sentinel/users/form.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | {{-- Page content --}} 4 | @section('body') 5 | 6 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | {{{ $errors->first('first_name', ':message') }}} 19 | 20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | {{{ $errors->first('last_name', ':message') }}} 29 | 30 |
31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | {{{ $errors->first('email', ':message') }}} 39 | 40 |
41 | 42 |
43 | 44 | 45 | 46 | 47 | 48 | {{{ $errors->first('password', ':message') }}} 49 | 50 |
51 | 52 | 53 | 54 |
55 | 56 | @stop 57 | -------------------------------------------------------------------------------- /app/views/sentinel/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | {{-- Page content --}} 4 | @section('body') 5 | 6 | 9 | 10 | @if ($users->count()) 11 | Page {{ $users->getCurrentPage() }} of {{ $users->getLastPage() }} 12 | 13 |
14 | {{ $users->links() }} 15 |
16 | 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach ($users as $user) 27 | 28 | 29 | 30 | 34 | 35 | @endforeach 36 | 37 |
NameEmailActions
{{ $user->first_name }} {{ $user->last_name }}{{ $user->email }} 31 | id}") }}">Edit 32 | id}/delete") }}">Delete 33 |
38 | 39 | Page {{ $users->getCurrentPage() }} of {{ $users->getLastPage() }} 40 | 41 |
42 | {{ $users->links() }} 43 |
44 | @else 45 |
46 | 47 | Nothing to show here. 48 | 49 |
50 | @endif 51 | 52 | @stop 53 | -------------------------------------------------------------------------------- /app/views/sentinel/wait.blade.php: -------------------------------------------------------------------------------- 1 | @extends('template') 2 | 3 | @section('title') 4 | Please Wait 5 | @stop 6 | 7 | @section('body') 8 | 9 |
10 | 11 | 14 | 15 |

16 | Very shortly, you will receive an email with instructions on how to continue. 17 |

18 | 19 |
20 | 21 | @stop 22 | -------------------------------------------------------------------------------- /app/views/template.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sentinel 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 27 |
28 | 29 | 67 | 68 | @if ($errors->any()) 69 |
70 | 71 | Error 72 | @if ($message = $errors->first(0, ':message')) 73 | {{ $message }} 74 | @else 75 | Please check the form below for errors 76 | @endif 77 |
78 | @endif 79 | 80 | @if ($message = Session::get('success')) 81 |
82 | 83 | Success {{ $message }} 84 |
85 | @endif 86 | 87 | 88 | @yield('body') 89 |
90 | 91 | 92 | 93 | 94 | 98 | 99 | @yield('scripts') 100 | 101 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /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); 75 | -------------------------------------------------------------------------------- /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('homestead'), 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 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "repositories": [ 7 | { 8 | "type": "composer", 9 | "url": "http://packages.cartalyst.com" 10 | } 11 | ], 12 | "require": { 13 | "laravel/framework": "4.2.*", 14 | "cartalyst/sentinel": "~1.0", 15 | "cbschuld/browser.php": "dev-master" 16 | }, 17 | "autoload": { 18 | "classmap": [ 19 | "app/commands", 20 | "app/controllers", 21 | "app/models", 22 | "app/database/migrations", 23 | "app/database/seeds", 24 | "app/tests/TestCase.php" 25 | ] 26 | }, 27 | "scripts": { 28 | "post-install-cmd": [ 29 | "php artisan clear-compiled", 30 | "php artisan optimize" 31 | ], 32 | "post-update-cmd": [ 33 | "php artisan clear-compiled", 34 | "php artisan optimize" 35 | ], 36 | "post-create-project-cmd": [ 37 | "php artisan key:generate" 38 | ] 39 | }, 40 | "config": { 41 | "preferred-install": "dist" 42 | }, 43 | "minimum-stability": "stable" 44 | } 45 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Cartalyst PSL 2 | Copyright (c) 2011-2014, Cartalyst LLC, 3 | All rights reserved. 4 | 5 | This license is a legal agreement between you and Cartalyst LLC for the use of 6 | any package (all versions) Software (the "Software"). By downloading any version 7 | of the Software you agree to be bound by the terms and conditions of this 8 | license. Cartalyst LLC reserves the right to alter this agreement at any time, 9 | for any reason, without notice. 10 | 11 | You may alter, modify, or extend the Software for your own use or for use in an 12 | integral part of your product or service, or commission a third-party to perform 13 | modifications for you, but you may not sub license, resell, share, transfer, or 14 | otherwise redistribute the modified or derivative version of the Software as a 15 | sole product without prior written consent from Cartalyst LLC. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 25 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /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/css/demo.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Globals 3 | */ 4 | 5 | .flux { 6 | position: absolute; 7 | top:0; 8 | left:0; 9 | right:0; 10 | border-bottom:4px solid #2d3337; 11 | } 12 | 13 | .flux--1 { 14 | background-color:#0F1C28; 15 | width:10%; 16 | float:left; 17 | height:8px; 18 | } 19 | .flux--2 { 20 | background-color:#136972; 21 | width:30%; 22 | float:left; 23 | height:8px; 24 | } 25 | .flux--3 { 26 | background-color:#67BFA7; 27 | width:44%; 28 | float:left; 29 | height:8px; 30 | } 31 | .flux--4 { 32 | background-color:#F3CF5B; 33 | width:8%; 34 | float:left; 35 | height:8px; 36 | } 37 | .flux--5 { 38 | background-color:#F07444; 39 | width:8%; 40 | float:left; 41 | height:8px; 42 | } 43 | 44 | /* Links */ 45 | a, 46 | a:focus, 47 | a:hover { 48 | color: #136972; 49 | } 50 | 51 | /* Custom default button */ 52 | .btn-default, 53 | .btn-default:hover, 54 | .btn-default:focus { 55 | color: #fff; 56 | text-shadow: none; /* Prevent inheritence from `body` */ 57 | background-color: #2d3337; 58 | border: 1px solid #fff; 59 | } 60 | 61 | /* 62 | * Base structure 63 | */ 64 | 65 | html, 66 | body { 67 | height: 100%; 68 | background-color: #fff; 69 | } 70 | body { 71 | color: #2d3337; 72 | text-align: left; 73 | padding-top:32px; 74 | } 75 | 76 | 77 | /* 78 | * Header 79 | */ 80 | .page-header { 81 | text-align: center; 82 | } 83 | 84 | .list li { 85 | padding:8px 0; 86 | border-bottom:1px solid #ddd; 87 | max-width: 800px; 88 | margin:0 auto; 89 | } 90 | 91 | 92 | @media (min-width: 992px) { 93 | .lead { 94 | font-size:28px; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /public/assets/css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.0.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"} 5 | -------------------------------------------------------------------------------- /public/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/public/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/public/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/public/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/public/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); -------------------------------------------------------------------------------- /public/assets/js/cart.js: -------------------------------------------------------------------------------- 1 | function ajaxCount(instance) 2 | { 3 | var target = $('.'+instance+'Count'); 4 | 5 | $.ajax({ 6 | url: instance+'/count' 7 | }).done(function(res) { 8 | target.addClass('alert-success'); 9 | target.text(res); 10 | 11 | setTimeout(function() 12 | { 13 | target.removeClass('alert-success'); 14 | }, 1000); 15 | }); 16 | } 17 | 18 | $(document).on('click', '.btn-add', function(e) 19 | { 20 | e.preventDefault(); 21 | 22 | var link = $(this).attr('href') + 'Ajax'; 23 | var self = $(this); 24 | 25 | $.ajax({ 26 | url: link 27 | }).done(function(res) { 28 | self.removeClass('btn-info').addClass('btn-danger').removeClass('btn-add').addClass('btn-remove').text('Remove'); 29 | self.attr('href', "cart/" + res.rowId + '/remove'); 30 | 31 | ajaxCount('cart'); 32 | }); 33 | }); 34 | 35 | $(document).on('click', '.wishlist-add', function(e) 36 | { 37 | e.preventDefault(); 38 | 39 | var link = $(this).attr('href') + 'Ajax'; 40 | var self = $(this); 41 | 42 | $.ajax({ 43 | url: link 44 | }).done(function(res) { 45 | self.removeClass('wishlist-add').addClass('wishlist-remove'); 46 | self.find('i').removeClass('fa-star-o').addClass('fa-star'); 47 | self.attr('href', "wishlist/" + res.rowId + '/remove'); 48 | 49 | ajaxCount('wishlist'); 50 | }); 51 | }); 52 | 53 | $(document).on('click', '.btn-remove', function(e) 54 | { 55 | e.preventDefault(); 56 | 57 | var link = $(this).attr('href') + 'Ajax'; 58 | var self = $(this); 59 | 60 | $.ajax({ 61 | url: link 62 | }).done(function(res) { 63 | if (res.message === 'success') 64 | { 65 | self.removeClass('btn-danger').addClass('btn-info').removeClass('btn-remove').addClass('btn-add').text('Add Cart'); 66 | self.attr('href', "cart/" + res.id + '/add'); 67 | 68 | ajaxCount('cart'); 69 | } 70 | }); 71 | }); 72 | 73 | $(document).on('click', '.wishlist-remove', function(e) 74 | { 75 | e.preventDefault(); 76 | 77 | var link = $(this).attr('href') + 'Ajax'; 78 | var self = $(this); 79 | 80 | $.ajax({ 81 | url: link 82 | }).done(function(res) { 83 | if (res.message === 'success') 84 | { 85 | window.aa = res; 86 | self.removeClass('wishlist-remove').addClass('wishlist-add'); 87 | self.find('i').removeClass('fa-star').addClass('fa-star-o'); 88 | self.attr('href', "wishlist/" + res.id + '/add'); 89 | 90 | ajaxCount('wishlist'); 91 | } 92 | }); 93 | }); 94 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/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/cartalyst/demo-sentinel/c1bd9459dbf6b4f64a5239025cb19ff29b58f979/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Sentinel Demo 2 | 3 | This is a basic demo showing some of the functionality of Sentinel on Laravel 4.2. 4 | 5 | ## Installation 6 | 7 | ##### 1. Clone this repo: 8 | 9 | ``` 10 | git clone git@github.com:cartalyst/demo-sentinel.git 11 | ``` 12 | 13 | ##### 2. Setup your virtual host. 14 | 15 | ##### 3. Go into your app directory in your terminal and install the dependencies: (cartalyst requires a subscription) 16 | 17 | ``` 18 | composer install 19 | ``` 20 | 21 | ##### 4. Configure your database connection by opening `app/config/database.php` file. 22 | 23 | ##### 5. Update the `app/config/mail.php` file to use your email credentials. 24 | >**Note:** make sure you set `pretend` to false after you configure your email credentials. 25 | 26 | ##### 6. Run the migrations 27 | 28 | ``` 29 | php artisan migrate --package="cartalyst/sentinel" 30 | ``` 31 | 32 | ##### 7. Run the migration & database seeder 33 | 34 | ``` 35 | php artisan migrate --seed 36 | ``` 37 | 38 | ##### 8. Publish the package to app folder(app/config/packages), so that you can manage throttling or other settings 39 | 40 | ``` 41 | php artisan config:publish cartalyst/sentinel 42 | ``` 43 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 |