├── .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 |A framework agnostic authorization and authentication package featuring roles, permissions, custom hashing algorithms and additional security features.
8 |This demo provides you a solid foundation of controllers and views for your next Application.
9 | 10 |11 | Github 12 | Documentation 13 |
14 | 15 |Password | 24 ||
---|---|
admin@example.com | 29 |password | 30 |
demo1@example.com | 33 |demo123 | 34 |
demo2@example.com | 37 |demo123 | 38 |
demo3@example.com | 41 |demo123 | 42 |
{{ $errors->first('email') }}
56 |{{ $errors->first('password') }}
64 |{{ $errors->first('email') }}
20 |{{ $errors->first('password') }}
28 |{{ $errors->first('password_confirm') }}
36 |Name | 22 |Slug | 23 |Actions | 24 | 25 | 26 | @foreach ($roles as $role) 27 |
---|---|---|
{{ $role->name }} | 29 |{{ $role->slug }} | 30 |31 | id}") }}">Edit 32 | id}/delete") }}">Delete 33 | | 34 |
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 |{{ $login }}
{{ $code }}
27 | Continue 28 |
29 | 30 |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 |Please enter your number (with country code). No spaces allowed.
16 | 17 | {{ Form::open(['class' => 'form-horizontal']) }} 18 | 19 |Name | 22 |Actions | 24 | 25 | 26 | @foreach ($users as $user) 27 ||
---|---|---|
{{ $user->first_name }} {{ $user->last_name }} | 29 |{{ $user->email }} | 30 |31 | id}") }}">Edit 32 | id}/delete") }}">Delete 33 | | 34 |
16 | Very shortly, you will receive an email with instructions on how to continue. 17 |
18 | 19 |