Compare commits

...

194 Commits

Author SHA1 Message Date
snipe bf1e075551 Fixes #87 - made datatables responsive 2014-10-16 17:46:47 -04:00
snipe 7c97477a53 Added default location to physical hardware 2014-10-16 17:41:56 -04:00
snipe ee7d9bec70 Fixes #279 - QR checkbox not staying checked 2014-10-16 15:39:05 -04:00
snipe 58a99a2219 Merge pull request #246 from mrshu/patch-2
fix: Use the old asset tag when cloning
2014-09-10 11:51:31 -04:00
Marek Šuppa a829fcf52f fix: Use the old asset tag when cloning
* Removed previous use of placeholder, added code to set the old asset tag as the new one since it is being checked for uniqueness.
* For more rationale see our discussion with @technogenus in #241
2014-09-10 08:55:57 +02:00
snipe af450c9bcc Merge pull request #241 from mrshu/patch-1
views: Added old tag to placeholder when cloning
2014-09-08 14:25:32 -04:00
snipe 5575567726 Merge pull request #235 from rrdial/patch-1
Spelling correction.
2014-09-08 14:25:01 -04:00
snipe 97724a95e3 Merge pull request #242 from mizar1616/spanish
Spanish Translation 1.0
2014-09-08 14:23:15 -04:00
mizar1616 2bf57febd8 Spanish Translation
Ver 1.1
2014-09-08 15:19:35 +02:00
Marek Šuppa a82a35d921 views: Added old tag to placeholder when cloning
* Added the old tag to the placeholder attribute of the `asset_tag` input to improve the UX.
2014-09-08 14:45:06 +02:00
R Ryan Dial 94ead64386 Spelling correction. 2014-09-02 14:57:27 -04:00
snipe e978038cc0 Merge pull request #234 from burlito/typo-fix
fix typo: artisand -> artisan
2014-09-01 23:53:31 -04:00
Andrej Manduch 96e40d72b9 fix typo: artisand -> artisan
In few app.example.php config files was artisand instead artisan.

Signed-off-by: Andrej Manduch <amanduch@gmail.com>
2014-09-02 05:47:12 +02:00
snipe 284154a2d7 Merge remote-tracking branch 'origin/master' into develop 2014-08-17 04:38:19 -04:00
snipe e0da7ffe9b Updated composer lock 2014-08-17 04:38:01 -04:00
snipe 35479bfa40 Removed pre-update-cmd 2014-08-17 04:37:38 -04:00
snipe 582a9bf78b Make location_id nullable 2014-08-17 04:37:30 -04:00
snipe e8c197c6a5 No upper cap to password 2014-08-15 23:10:41 -04:00
snipe ec658b0cf5 Stronger input validation 2014-08-15 22:13:09 -04:00
snipe 68d44e65d3 XSS filtering 2014-08-15 22:12:48 -04:00
snipe 6fd0cbe044 Allow up to 50-character password 2014-08-15 21:02:41 -04:00
snipe 4629875bdf Removed ID from listbox debugging 2014-08-15 20:16:19 -04:00
snipe 297f986c4b Merge remote-tracking branch 'origin/develop' 2014-08-15 20:11:00 -04:00
snipe ccb49f4b23 I don't know why I have to keep committing this file 2014-08-15 20:10:52 -04:00
snipe 49c5607e1c Fixes #222 2014-08-15 20:05:48 -04:00
snipe 13f61e1e8a Newline 2014-08-15 19:46:10 -04:00
snipe cd4e994ef5 Removed erronerous "All the users!" text 2014-08-15 19:27:35 -04:00
snipe 974fb6b9ae Added language string for #222 2014-08-15 19:15:00 -04:00
snipe 4365659a2c Removed IDE files 2014-08-13 15:45:29 -04:00
snipe 363d084bd6 Fixed DB name in travis CI 2014-08-12 15:06:52 -04:00
snipe 69cd6404f5 Merge remote-tracking branch 'origin/develop' 2014-08-12 14:58:48 -04:00
snipe 229291999f ... 2014-08-12 14:58:40 -04:00
snipe 2cb61ab1c5 Added link to @GR360RY's Ubuntu Ansible/Vagrant 2014-08-12 14:57:53 -04:00
snipe 652f1c746c Fixes Travis CI build 2014-08-12 14:53:51 -04:00
snipe caaa96ec67 ... 2014-08-12 14:39:59 -04:00
snipe db49e570fd ... 2014-08-12 14:03:29 -04:00
snipe e242f8da0d Merge pull request #216 from cordeos/develop
A0.4.3 add asset, license, user, model clone and artisan db migration
2014-08-12 13:52:51 -04:00
Cordeos Team 8d3d8c86b1 A0.4.3 add asset, license, user, model clone and artisan db migration 2014-08-12 17:25:07 +09:00
Cordeos Team 144c9eb7f8 A0.4.2: asset, license, user, model cloning and move db migration 2014-08-12 15:54:12 +09:00
Cordeos Team 9ccc7d756f A0.4.2: Added asset, license, user, model cloning and fixed some bugs. 2014-08-12 14:28:41 +09:00
Cordeos Team b1fafa7ca4 Added asset, license, user and model cloning 2014-08-12 13:41:17 +09:00
Cordeos Team 62a3ed671b DB migration, layout and clone fixes 2014-08-11 20:18:45 +09:00
Cordeos Team 7ac06fa004 DB migration script Rev 0.11 2014-08-11 17:45:11 +09:00
Cordeos Team 54c3dfbcce Added licence clone 2014-08-11 17:19:28 +09:00
Cordeos Team 0dfc9660ca alpha 0.4.0 release candidate 2014-08-11 17:13:43 +09:00
Cordeos Team d6404dc734 0.4.1 release candidate 2014-08-11 13:32:24 +09:00
Cordeos Team d482b1ea69 0.4.0 release candidate 2014-08-11 13:22:42 +09:00
Cordeos Team 8c7be8fbb3 0.4.0 release candidate 2014-08-11 13:15:08 +09:00
Cordeos Team 3944ebddf3 0.4.0 release candidate 2014-08-11 13:14:22 +09:00
Cordeos Team 6cfb4ab5d8 0.4.0 release candidate 2014-08-11 13:10:00 +09:00
Cordeos Team 64abdddccb Database migration update 2014-08-10 22:59:57 +09:00
Cordeos Team 23a64cfe26 Database migration update 2014-08-10 22:35:14 +09:00
Cordeos Team 448b54d8e2 DBUpdate 2014-08-10 22:08:38 +09:00
Cordeos Team 72671d3e1d initial beta .4 draft 2014-08-10 20:01:38 +09:00
Cordeos Team efbe7b0fee initial beta .4 draft 2014-08-10 19:58:23 +09:00
Cordeos Team af083570a0 initial beta .4 draft 2014-08-10 19:09:08 +09:00
Cordeos Team 87c2a4c9c0 initial commit 2014-08-10 16:42:40 +09:00
root cb8369e9de Initial QA Patch to fix errors
Add License
Add Asset
Show Deleted Users
License Assign
2014-08-08 00:03:12 +09:00
root 6c5bbec44e Changes:
Updated user create to make LOCATION required - same as user edit
Own account password change updated to require only 6-12 characters
2014-08-05 14:56:37 +09:00
root d71a02982d Changes:
set new user create to active YES as default
Changed user password validation to 6-12 characters
Licenses controller removed asset_id from the INSERT column list
2014-08-05 13:36:47 +09:00
root b8a4c7e4d6 Initial COMMIT to set the file modified tracking. No changes made. 2014-08-05 13:22:08 +09:00
snipe 8197e6174e Fixes #200 2014-07-22 17:57:50 -04:00
snipe 3de929bb28 Merge pull request #199 from buzzedword/feature/gitignore-bin
Add bin directory to gitignore so vendor assets don't get committed.
2014-07-22 15:10:57 -04:00
snipe f2036e0951 Merge pull request #197 from jarnokurlin/develop
user id 3 does not exists!
2014-07-22 14:54:42 -04:00
Danny Garcia 213e313e45 Add bin directory to gitignore so vendor assets don't get committed. 2014-07-22 14:52:08 -04:00
snipe a695d8513c Merge pull request #198 from buzzedword/feature/bug-58
Fixed #58
2014-07-22 14:24:02 -04:00
Danny Garcia 69fca5d1ed Fixed #58
Added module scoping for all components, and stored lookups in event handlers instead
of querying live. Delays would erroniously cause values to persist.
2014-07-22 13:33:58 -04:00
Jarno Kurlin 94daba9bab user id 3 does not exists! 2014-07-22 18:53:45 +03:00
snipe 56d619b218 Fixed missing language string 2014-07-19 18:10:10 -04:00
snipe dc1033025a Fixed #151 - more complete translations 2014-07-19 17:53:04 -04:00
snipe a4b220d6c3 Fixed #191 - allow admins to assign a user during asset creation 2014-07-19 17:28:51 -04:00
snipe a8c2955218 Updated changelog 2014-07-19 01:30:24 -04:00
snipe 03cd9f893c Better asset dropdown to include user it's assigned to where applicable 2014-07-19 01:16:53 -04:00
snipe 4f04b96a13 Adding 5.6 back in 2014-07-18 23:55:44 -04:00
snipe d2d85436ad Tweaks to travis 2014-07-18 23:54:11 -04:00
snipe 85cd343bb6 Tried again - tweaking travis settings 2014-07-18 23:51:49 -04:00
snipe 6f6b98186e NFC why this is suddenly failing :( 2014-07-18 23:48:43 -04:00
snipe f855be45aa Removed 5.6 2014-07-18 23:45:01 -04:00
snipe ddf946ad5e Tried to fix failing build caused by travis composer 2014-07-18 23:42:36 -04:00
snipe 4a13cded60 Fixed path for Travis composer 2014-07-18 23:40:57 -04:00
snipe 27e43eebcb Added asset tag to license index view 2014-07-18 23:29:05 -04:00
snipe 196dbb856e Merge remote-tracking branch 'origin/develop' 2014-07-18 23:25:48 -04:00
snipe 3d91a43554 Added asset tag to asset list 2014-07-18 23:25:33 -04:00
snipe 9df9371ffe Merge remote-tracking branch 'origin/develop' 2014-07-18 20:25:12 -04:00
snipe ca24ef1cd8 Merge branch 'refs/heads/feature/add-asset-to-software' into develop
Conflicts:
	app/controllers/admin/LicensesController.php
2014-07-18 20:24:51 -04:00
snipe ac4c905c42 Fixed #140 2014-07-18 20:09:58 -04:00
snipe 7f48ca04b0 Updated changelog 2014-07-17 14:01:04 -04:00
snipe 39fff92bdb Updated changelog 2014-07-17 13:57:58 -04:00
snipe 43b98eff92 Merge remote-tracking branch 'origin/develop' 2014-07-17 13:54:10 -04:00
snipe e203fc516f Fixes #194 2014-07-17 13:51:58 -04:00
snipe ff61705a8f More edits for #140 2014-07-17 13:38:53 -04:00
snipe aa8bbb88e9 Updated MVC for #140, ability to assign software to asset (incomplete) 2014-07-17 08:33:30 -04:00
snipe 7d04ded02a DB migration for #140 2014-07-17 08:32:11 -04:00
snipe 04ea0528a8 Merge remote-tracking branch 'origin/develop' 2014-07-16 18:21:42 -04:00
snipe 89000440f3 Added admin ability to unsuspend locked accounts #changelog 2014-07-16 18:21:22 -04:00
snipe 73b469621f Merge remote-tracking branch 'origin/develop' 2014-07-13 07:35:28 -04:00
snipe e94087d62b Changed country to dropdown 2014-07-11 19:12:53 -04:00
snipe 21251b4623 Fixed #190, where depreciation on licenses would not be saved 2014-07-09 21:12:58 -04:00
snipe 381f99543f Merge remote-tracking branch 'origin/develop' 2014-07-09 11:58:47 -04:00
snipe 6f2b78ad9f Added DB migration for #15 2014-07-09 11:50:54 -04:00
snipe 6043321bed Added checkbox for marking an asset as requestable 2014-07-09 10:35:15 -04:00
snipe 03dffa3541 Added language string for requestable field 2014-07-09 10:34:54 -04:00
snipe 99003e126a Fixed bug with edit (supplier_id), added requestable field for assets 2014-07-09 10:34:39 -04:00
snipe 82a84310ed Added links to documentation and issues in footer 2014-07-09 08:45:11 -04:00
snipe 9dc40a3a9c Fixed a few CSS quirks 2014-07-09 08:45:02 -04:00
snipe 784f7e8dec WTF is wrong with me this morning? Hurr. 2014-07-09 07:08:15 -04:00
snipe deb9f42ec8 Added gitbook.io badge 2014-07-09 07:07:22 -04:00
snipe beb4d6500a Added back the line separators 2014-07-09 07:05:47 -04:00
snipe 45fa66b41e Updated copy 2014-07-09 07:03:10 -04:00
snipe 8eb2523293 Updated README to point to new documentation URL/branch 2014-07-09 07:02:08 -04:00
snipe 2b9494ed82 Fixed inconsistent password requirements across admin user creation, user profile and forgotten password 2014-07-09 05:18:53 -04:00
snipe 66c9264fcb More consistent spacing on forgotten password page (col-md-3) 2014-07-09 05:11:53 -04:00
snipe f22f23f21d Fixed button label on forgotten password page 2014-07-09 05:10:57 -04:00
snipe 90eb883b67 Fixed #187 - replaced dummy site name with site name from admin panel preferences 2014-07-09 05:04:49 -04:00
snipe 300358bc46 Link to demo 2014-07-09 03:38:09 -04:00
snipe 3cffff3415 Added "still maintained" badge 2014-07-09 03:22:02 -04:00
snipe 4253744d9d Merge remote-tracking branch 'origin/develop' 2014-07-09 03:10:42 -04:00
snipe 6b5a552d95 Fixed #186 - Bug with select box not retaining selections on edit screen 2014-07-09 03:09:55 -04:00
snipe 43485e1a51 Fixed language definition 2014-07-09 02:50:58 -04:00
snipe 5cdceb1db1 Merge remote-tracking branch 'origin/develop' 2014-07-08 19:55:03 -04:00
snipe 0c285d64bc Tightened up Bootstrap 3 design, took care of leftover elements from 2.3 2014-07-08 19:47:19 -04:00
snipe 38cdbf8804 Added submit button language file 2014-07-08 19:44:17 -04:00
snipe 9606834e14 Made password length match 10 character standard imposed by admin user creation 2014-07-08 19:44:06 -04:00
snipe 276b1553c1 Mark required form elements as required 2014-07-08 19:17:31 -04:00
snipe 182f2bfa62 Merge remote-tracking branch 'origin/develop' 2014-07-08 05:38:27 -04:00
snipe 5266d9a30a Fixed title tag for user list view 2014-07-08 05:38:07 -04:00
snipe 6068a940bd Added employee number to user view, per #183 2014-07-08 04:44:36 -04:00
snipe fc032c95b4 Misc indenting 2014-07-08 04:40:09 -04:00
snipe 2265b9321e Additional language strings for #151 2014-07-08 04:40:01 -04:00
snipe a7b809cb91 Updated title/header for users, additional fixes for #151 2014-07-08 04:39:51 -04:00
snipe af269b536e Refactored users to use same form for edit/create 2014-07-08 04:35:23 -04:00
snipe 89a8f3c277 Fixes #183 - added employee number to users 2014-07-08 02:57:15 -04:00
snipe 57b3f6c44f Security recommendations 2014-07-07 13:58:51 -04:00
snipe 380ff9917d Updated changelog for newest release 2014-07-02 22:12:06 -04:00
snipe 6532f1aba5 Merge remote-tracking branch 'origin/develop' 2014-07-02 22:08:38 -04:00
snipe 49dfd259b4 Props where props are due, yo. 2014-07-02 22:05:09 -04:00
snipe fad2ec66fa More README fixes and refinement 2014-07-02 22:00:45 -04:00
snipe e455de65f9 Added table of contents outline to README for easier readability 2014-07-02 21:54:33 -04:00
snipe 7a0c1cc6ff Streamlined README for easier production install, developer instructions moved to the bottom. 2014-07-02 21:43:37 -04:00
snipe 2517359f3a Merge remote-tracking branch 'origin/develop' 2014-07-02 14:58:27 -04:00
snipe c782f29f5a Pulled account sub-nav into top menu to free up UI space. #changelog 2014-07-02 13:56:12 -04:00
snipe 2825bcb431 Fixed #179 - account page to show assets checked out to the logged in user 2014-07-02 13:55:34 -04:00
snipe 1117c2958a Slightly nicer output 2014-06-27 20:17:42 -04:00
snipe 4464c221b7 Better changelog 2014-06-27 19:05:13 -04:00
snipe 21e6f2c249 Merge remote-tracking branch 'origin/develop' 2014-06-27 17:28:22 -04:00
snipe ec9eab81bf Closes #177 - change log file added, needs refining 2014-06-27 17:27:53 -04:00
snipe b863bd2c53 Merge remote-tracking branch 'origin/develop' 2014-06-26 13:28:41 -04:00
snipe 09ca2be28d Merge pull request #175 from leostat/develop
Fix for ~167
2014-06-26 13:28:12 -04:00
leostat a170efae27 fix for #167 2014-06-26 11:10:13 +01:00
leostat 919119c5b9 Sanatise fullname class #167 2014-06-26 10:45:31 +01:00
snipe 7cb0db5b83 Added local flag for easier install 2014-06-25 04:24:13 -04:00
snipe d24c4ed7eb Widened column for nicer layout 2014-06-24 18:22:26 -04:00
snipe a0f7083e9c Improved bootstrap nav for mobile 2014-06-24 18:04:15 -04:00
snipe 8b914102b7 Updated spacing for PSR-2 2014-06-24 17:49:39 -04:00
snipe 77f4848d6e Missed a few 2014-06-24 17:45:21 -04:00
snipe afabd28142 Additional fixes for #167 2014-06-24 16:28:20 -04:00
snipe 67d23bdb45 Janky url validator to add http:// 2014-06-24 15:51:13 -04:00
snipe 124acc89c4 Resolves #174 2014-06-24 14:15:39 -04:00
snipe 5c0e912080 Merge remote-tracking branch 'origin/develop' 2014-06-23 23:52:51 -04:00
snipe 47a8363f1d Merge pull request #173 from madd15/develop
Remove Double 'Display QR Codes' and change triple =
2014-06-23 23:48:15 -04:00
snipe b09aec67f1 Fixes #155 2014-06-23 23:46:14 -04:00
snipe 86400f435b New list URL 2014-06-23 23:36:13 -04:00
madd15 82f0c6f00c Change to Triple = and no ' 2014-06-24 13:02:13 +09:30
madd15 9fe76a21f6 Remove double 'Display QR Codes' 2014-06-24 12:46:37 +09:30
snipe 264a6e304d Link to mailing list 2014-06-23 23:12:45 -04:00
snipe ad62ec7540 Merge pull request #172 from madd15/develop
Check boxes in settings not showing correct settings
2014-06-23 23:06:25 -04:00
madd15 3b9f96419b Check boxes not showing correct settings 2014-06-24 12:31:43 +09:30
snipe 6b8ed1a1ad Merge pull request #171 from madd15/develop
Change Back Button Icon on Update Supplier
2014-06-23 22:44:06 -04:00
madd15 164ca5f77b Change Back Button Icon on Update Supplier 2014-06-24 12:12:45 +09:30
snipe a142afe177 Oops. Forgot zip code. 2014-06-23 22:38:19 -04:00
snipe 15d48c903e Helpful links for hardware view 2014-06-23 22:33:42 -04:00
snipe cbd3420327 Better phrasing 2014-06-23 22:23:14 -04:00
snipe 380417953b Fixed missing string 2014-06-23 22:17:07 -04:00
snipe 6f42b3045e Resolves #155 2014-06-23 22:09:32 -04:00
snipe b717a3ee34 Merge pull request #170 from madd15/develop
Fix #117
2014-06-23 20:59:16 -04:00
madd15 945cb3253f Fix #117
Fix CCS for #117
#166 also fixed edit user page
2014-06-24 10:25:35 +09:30
snipe 3e7a9e45d1 Fixes PR #168 and #167 2014-06-23 19:40:09 -04:00
snipe 0c9d94deb1 Merge pull request #166 from madd15/develop
No Result on user page not showing correctly
2014-06-23 18:19:41 -04:00
madd15 19de7425e6 Select2.css image paths - #2
Change image paths in select2.css to match correct location of images.
Damn I fail.
2014-06-23 10:37:54 +09:30
madd15 3cc038208f Revert "Select2.css image paths"
This reverts commit a48efb8855.
2014-06-23 10:33:22 +09:30
madd15 a48efb8855 Select2.css image paths
Change image paths in select2.css to match correct location of images.
2014-06-23 10:18:02 +09:30
Josh Deakin 7ddf84adf7 Change Warning to Info User no results 2014-06-21 12:43:18 +09:30
Josh Deakin 57628d725e User No Results
Change No Results on user page to general no results
2014-06-21 12:37:51 +09:30
snipe 45f353e575 Merge remote-tracking branch 'origin/develop' 2014-06-19 22:23:09 -04:00
snipe bef5170b7c More cleanup 2014-06-19 22:19:20 -04:00
snipe e7e75631c5 Merge remote-tracking branch 'origin/bugs/160' into develop 2014-06-19 22:15:44 -04:00
snipe a4c931e4fd Cleanup 2014-06-19 22:14:54 -04:00
snipe d1499deecd Provisions for strict mode, fixed license deletion bug 2014-06-19 22:13:59 -04:00
snipe b365ada0ce Provisions for strict mode 2014-06-19 22:13:43 -04:00
snipe 185ffd3df1 Merge remote-tracking branch 'origin/develop' 2014-06-19 18:27:59 -04:00
snipe 5fdb61589f Linked to Waffle in text 2014-06-19 18:20:14 -04:00
snipe b3292c3a35 Updated README with waffle.io info 2014-06-19 18:14:21 -04:00
snipe 4ce1c94bc3 Merge remote-tracking branch 'origin/master' into develop 2014-06-19 16:10:27 -04:00
snipe 08d05b481f Fixes #158 2014-06-19 16:10:00 -04:00
424 changed files with 16031 additions and 24902 deletions
Executable
+37
View File
@@ -0,0 +1,37 @@
ls
pwd
cd app
ls
cd views/
cd backend/
ls
cd users/
ls
vi view.blade.php
ls -alF
cd
pwd
ls -alF
pwd
cd app
ls
cd views/
cd backend/
cd users/
ls
ls -alF
chown snipeitftp view.blade.php
sudo chown snipeitftp view.blade.php
pwd
ls
vi view.blade.php
set noswapfile
set nobackup
vi view.blade.php
touch delete.me
vi delete.me
ls
ls -alF
touch view.blade.php
touch index.blade.php
vi view.blade.php
+2 -1
View File
@@ -12,4 +12,5 @@ composer.phar
public/packages/*
/app/storage/views/*
/app/storage/logs/*
/app/storage/debugbar/
/app/storage/debugbar/
/bin/
Regular → Executable
+1 -3
View File
@@ -17,9 +17,7 @@ before_script:
- curl -s http://getcomposer.org/installer | php
- cp app/config/production/database.example.php app/config/database.php
- cp app/config/production/mail.example.php app/config/mail.php
- php composer.phar self-update
- php composer.phar validate
- php composer.phar install --prefer-source --no-interaction --dev
- composer install --prefer-source --no-interaction --dev
- php artisan key:generate
- php artisan migrate:install
- php artisan migrate --package cartalyst/sentry
Executable
+137
View File
@@ -0,0 +1,137 @@
### v0.3.11-alpha - Released Jul 19, 2014 07:16:53
#### This is a pre-release
### v0.3.10-alpha - Released Jul 17, 2014 07:54:10
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/89a8f3c277d2482b2cd04c4c5c582c9e507770f8">view</a> &bull; Fixes #183 - added employee number to users
* <a href="http://github.com/snipe/snipe-it/commit/a7b809cb91f49fb2c8eaecc67822fa155a0f20ce">view</a> &bull; Updated title/header for users, additional fixes for #151
* <a href="http://github.com/snipe/snipe-it/commit/5266d9a30a9663fa80ff764b25ff71726e5c4f4c">view</a> &bull; Fixed title tag for user list view
* <a href="http://github.com/snipe/snipe-it/commit/43485e1a51330ef585a65b469d7eb85ae7bde13a">view</a> &bull; Fixed language definition
* <a href="http://github.com/snipe/snipe-it/commit/6b5a552d95ff6f6d5567275b50fcd487fb793820">view</a> &bull; Fixed #186 - Bug with select box not retaining selections on edit screen
* <a href="http://github.com/snipe/snipe-it/commit/90eb883b671919ea360122c2bf44433995a12144">view</a> &bull; Fixed #187 - replaced dummy site name with site name from admin panel preferences
* <a href="http://github.com/snipe/snipe-it/commit/f22f23f21dc11d393854849580f0c1229cec9827">view</a> &bull; Fixed button label on forgotten password page
* <a href="http://github.com/snipe/snipe-it/commit/2b9494ed8271254f8f84e016f238d518e6109842">view</a> &bull; Fixed inconsistent password requirements across admin user creation, user profile and forgotten password
* <a href="http://github.com/snipe/snipe-it/commit/9dc40a3a9c161267fd8c88aacc1fbf536c1ec2de">view</a> &bull; Fixed a few CSS quirks
* <a href="http://github.com/snipe/snipe-it/commit/99003e126a8fd0ad9aaea5a550e0af5e306fc1bb">view</a> &bull; Fixed bug with edit (supplier_id), added requestable field for assets
* <a href="http://github.com/snipe/snipe-it/commit/21251b462308f2d783b83be1a331a0faf0813d16">view</a> &bull; Fixed #190, where depreciation on licenses would not be saved
* <a href="http://github.com/snipe/snipe-it/commit/89000440f344f766a31adc69718d7f66df235abf">view</a> &bull; Added admin ability to unsuspend locked accounts #changelog
* <a href="http://github.com/snipe/snipe-it/commit/e203fc516fadf6218f5ce87c070d0cdba9fca188">view</a> &bull; Fixes #194
### v0.3.9-alpha - Released Jul 03, 2014 04:08:38
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/2825bcb4310899e89ccbc73dfa8b59ade28018da">view</a> &bull; Fixed #179 - account page to show assets checked out to the logged in user
* <a href="http://github.com/snipe/snipe-it/commit/c782f29f5aae752a6246be9778d418df172dd4f6">view</a> &bull; Pulled account sub-nav into top menu to free up UI space. #changelog
* <a href="http://github.com/snipe/snipe-it/commit/fad2ec66fa9abe0b34baf16cce453a7e9fc9e4d4">view</a> &bull; More README fixes and refinement
### v0.3.8-alpha - Released Jun 27, 2014 11:28:22
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/3e7a9e45d1954531bbc3b73f2ed59dd16d59c657">view</a> &bull; Fixes PR #168 and #167
* <a href="http://github.com/snipe/snipe-it/commit/945cb3253f1349e30aafa4e7cb57bb507a2ea0cc">view</a> &bull; Fix #117
* <a href="http://github.com/snipe/snipe-it/commit/6f42b3045e2a65cdf98ec1038284cc2ecf01fa5d">view</a> &bull; Resolves #155
* <a href="http://github.com/snipe/snipe-it/commit/380417953b6b67a506f0cc395fd2dfb744cf26cd">view</a> &bull; Fixed missing string
* <a href="http://github.com/snipe/snipe-it/commit/b09aec67f1ab76ff0435a2e1e49b179c3d73bc12">view</a> &bull; Fixes #155
* <a href="http://github.com/snipe/snipe-it/commit/124acc89c4027e346daf54c62cb38b85586de870">view</a> &bull; Resolves #174
* <a href="http://github.com/snipe/snipe-it/commit/afabd2814205fdcd83b7bf9ce9095aa367b08311">view</a> &bull; Additional fixes for #167
* <a href="http://github.com/snipe/snipe-it/commit/a170efae2796314896d548d86b79d89d859c37d2">view</a> &bull; fix for #167
* <a href="http://github.com/snipe/snipe-it/commit/ec9eab81bfb3b35bfe7ad06008b26f19009e6638">view</a> &bull; Closes #177 - change log file added, needs refining
### v.0.3.5-alpha - Released Jun 20, 2014 04:23:09
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/d1499deecdff3c7a4235ffdfad5adbddc1a5098f">view</a> &bull; Provisions for strict mode, fixed license deletion bug
### v.0.3.4-alpha - Released Jun 20, 2014 12:27:59
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/08d05b481f6366ad48fcdce72a8df53755f5dee8">view</a> &bull; Fixes #158
### v.0.3.3-alpha - Released Jun 18, 2014 10:04:46
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/3518ab9f55f7992d6d4f886389d67b062a02f2d8">view</a> &bull; Fixes #139
* <a href="http://github.com/snipe/snipe-it/commit/ad9b1fc446ab15157502fe7c52ddbda455e3ea8f">view</a> &bull; Fixes #139
* <a href="http://github.com/snipe/snipe-it/commit/dfa5d1c64205b23c4c3d16190d1478da8aa0edbb">view</a> &bull; Fixes #136
* <a href="http://github.com/snipe/snipe-it/commit/9714178ce1fa1e2814389e4b6b82eb596a650084">view</a> &bull; Fixes #141
* <a href="http://github.com/snipe/snipe-it/commit/607484b29407718238571eb5269c9c27830338f7">view</a> &bull; Fixes #141 for mysql with strict mode enabled
* <a href="http://github.com/snipe/snipe-it/commit/cbc945299e7f67f5f10dfdc6a875e5c53ac8440a">view</a> &bull; Fixes #148
* <a href="http://github.com/snipe/snipe-it/commit/dc256583d410cb09253e30b075149c79fb4864e5">view</a> &bull; Fixes #144
* <a href="http://github.com/snipe/snipe-it/commit/610c405aa50118163ad5d26d43e4bf6c2456f624">view</a> &bull; More fixes for #151
### v.0.3.2-alpha - Released May 06, 2014 10:26:21
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/f4c5da57d0397877d90aa398267e59fcffee7b47">view</a> &bull; Fixed auth error when user isn't logged in
### v.0.3.1-alpha - Released May 06, 2014 06:48:09
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/efad5db082d1461ea26556fad2f1671a49dc1480">view</a> &bull; Fix for broken datatables in upgrading to v2.2
* <a href="http://github.com/snipe/snipe-it/commit/5690e9ce1f178486179ce6cdfb00ca417acd87dd">view</a> &bull; Fixed code indentation for Apache virtualhost example
* <a href="http://github.com/snipe/snipe-it/commit/67aba76d3f83c5f374c05fe07d52eebd81d13278">view</a> &bull; Fixing this change from #109 that somehow got reverted
* <a href="http://github.com/snipe/snipe-it/commit/06067fc19c0127fdcbb78541e7cdc8e77f5444ac">view</a> &bull; Fixed CSV rexport
### v0.3.0-alpha - Released Jan 29, 2014 02:28:31
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/d91d75abe4df19dd6cd54705ba9967295973ced0">view</a> &bull; Fixing JSON parse errors from #97
* <a href="http://github.com/snipe/snipe-it/commit/baab758377e117a86c3273dd1d6e03e66b02dc8b">view</a> &bull; Fixed language support
* <a href="http://github.com/snipe/snipe-it/commit/a678ec41714f5d7f77418b5933bc112aa67eae9c">view</a> &bull; Fixed Gravatar Hash
* <a href="http://github.com/snipe/snipe-it/commit/c08d672e4923b12972eae76d0699e6a301f911cd">view</a> &bull; Fixes mail config documentation
* <a href="http://github.com/snipe/snipe-it/commit/fba853a6a7a2f8166265cac2e99a526fd9b88c7b">view</a> &bull; Fixes composer formatting issues
* <a href="http://github.com/snipe/snipe-it/commit/c11510fdcac2b2de09ae9e241c846426bdf0b187">view</a> &bull; Removes sorting from actions column. Fixes #56
* <a href="http://github.com/snipe/snipe-it/commit/ae05f2701559a841cb8d9bc8767e6d7a56dcd93c">view</a> &bull; Fixed depreciation bug
* <a href="http://github.com/snipe/snipe-it/commit/d591c1ea0495de091eb0f71daa8572929096c897">view</a> &bull; Fixed bug where RTD = 1 instead of 0
* <a href="http://github.com/snipe/snipe-it/commit/e49420f62d26405b2fa0385f0ae7b3009b3beeaf">view</a> &bull; Fixed bug in depreciation display
* <a href="http://github.com/snipe/snipe-it/commit/1dc7fd1bdf8852fed6d886938f632c8ea69d4798">view</a> &bull; Fixed depreciation display on asset view
* <a href="http://github.com/snipe/snipe-it/commit/211a527ae176df667f6f8fbc95901c53a368d8e2">view</a> &bull; Fixed FK
* <a href="http://github.com/snipe/snipe-it/commit/aaebaa8d36158aafc61988a6370239e85f2e75e5">view</a> &bull; Bugfix to put custom title in the page title
* <a href="http://github.com/snipe/snipe-it/commit/194150bbf0493512018390d011e8d88d144e9763">view</a> &bull; Hacky shit to fix pagination weirdness - will come back to this
* <a href="http://github.com/snipe/snipe-it/commit/5fb649b59e76aa9db6e433ad8c9fc75b4b8d5fc2">view</a> &bull; Fixed error message layout
* <a href="http://github.com/snipe/snipe-it/commit/7bc9a53b133895206a3df230baca50d3879abbe5">view</a> &bull; Fixed error when user is invalid
* <a href="http://github.com/snipe/snipe-it/commit/82de635a75aba376209b741ce1ed4497b91e65e0">view</a> &bull; Fixed invalid seed data
* <a href="http://github.com/snipe/snipe-it/commit/b697c77cd85416ca502ec3bb28c990099c7faae3">view</a> &bull; Fixing error when no depreciation
* <a href="http://github.com/snipe/snipe-it/commit/432f44118f46381bdaa44daf61dfa35677aba0ee">view</a> &bull; Fixed FK in licenses model
* <a href="http://github.com/snipe/snipe-it/commit/4468cbd096e9990300240205baf7139eafbc423c">view</a> &bull; Fixes #112
* <a href="http://github.com/snipe/snipe-it/commit/cd62be0de03da071f344c8f66730cbc9e1475fb7">view</a> &bull; Minor div fix
* <a href="http://github.com/snipe/snipe-it/commit/9c369d72e1e7e29f3c205586c916b2f42b250047">view</a> &bull; Fixed typo
* <a href="http://github.com/snipe/snipe-it/commit/60d94eea04d1ebb93704e6a0d20621ff18708272">view</a> &bull; Changes serial to text area, allow new lines. Fixes #118
* <a href="http://github.com/snipe/snipe-it/commit/580590b4c0b4a2f76ef8edfe02de986267fc7395">view</a> &bull; Fixed === to == (PHP is loosely typed)
### v0.2.0-alpha - Released Nov 29, 2013 11:09:07
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/06cbd0723e415d81ea12aa48f2c37188741b2dbc">view</a> &bull; Fixes #93
* <a href="http://github.com/snipe/snipe-it/commit/e305099b45401c871f16fec23c200080830fcd5d">view</a> &bull; Fixed model view
* <a href="http://github.com/snipe/snipe-it/commit/7003eff42ca0e0ea2b9070187c0afd8ba1a8d8b0">view</a> &bull; More fixes for #88
* <a href="http://github.com/snipe/snipe-it/commit/567f395afaa19335671f366ce889630426f33273">view</a> &bull; More fixes for #88
* <a href="http://github.com/snipe/snipe-it/commit/02f1977d301cd449aa806e02e8a829516d436ef7">view</a> &bull; Fixed error message
* <a href="http://github.com/snipe/snipe-it/commit/11c657ffa4c3bdd01cd04b81d01980b2d795107c">view</a> &bull; Fixes #36
### v0.1.2-alpha - Released Nov 29, 2013 02:59:05
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/b1aa67ddb72158513f0a706996c8c1f5b3609aa5">view</a> &bull; Fixes #69
* <a href="http://github.com/snipe/snipe-it/commit/aa38d83ba6369215451d905e599492214e9f4b8b">view</a> &bull; Fixes #63 and #70
* <a href="http://github.com/snipe/snipe-it/commit/65cd28aad3903e11879e01faba382454dec7e75c">view</a> &bull; Fixes #14
* <a href="http://github.com/snipe/snipe-it/commit/6552401fd869fd285aef5e217438f4f055b53ab6">view</a> &bull; Fixes #77
* <a href="http://github.com/snipe/snipe-it/commit/012a889444fa25b174a5fb2c67e89c8c5fcf09aa">view</a> &bull; Corrected license seat count associated with license. Fixes #75
* <a href="http://github.com/snipe/snipe-it/commit/9e189aa309750c221c27352f35e2ca1f5fab9173">view</a> &bull; Fixes #80, also prevents the user from checking out an asset that is undeployable, etc
* <a href="http://github.com/snipe/snipe-it/commit/8680d98bc36bffa08f87020300b315d26be09928">view</a> &bull; Fixed status display bug
* <a href="http://github.com/snipe/snipe-it/commit/4fcdf72ab6505625f244a6e6ee8683204fb81ccd">view</a> &bull; Responsive design bug fixes, placeholder code for #64 (commented out)
* <a href="http://github.com/snipe/snipe-it/commit/d9a37f38228d55bb6265efc626e3ab7919013362">view</a> &bull; Fixes #88
* <a href="http://github.com/snipe/snipe-it/commit/5858bfb99b2144fbc805ec62cc90e6aaaf019f77">view</a> &bull; Fixed language file paths caused by #88
* <a href="http://github.com/snipe/snipe-it/commit/9f7cbc8a4f01ddf2596e831f658c9a8c321b2f46">view</a> &bull; Another fix related to #88, also accounts for users with invalid location_ids
* <a href="http://github.com/snipe/snipe-it/commit/f0f07b578b2439a627e5e946df0849d88d8526cf">view</a> &bull; Fixing pivot for users
* <a href="http://github.com/snipe/snipe-it/commit/9fa826b2e77ce22d25a8b3094bc825802d25be85">view</a> &bull; Fixed assigned to id
### v0.1.1-alpha - Released Nov 27, 2013 12:11:00
#### This is a pre-release
* <a href="http://github.com/snipe/snipe-it/commit/1527b88fd671a20c879c9b2061ae95f3b386ba27">view</a> &bull; Fixes #61
* <a href="http://github.com/snipe/snipe-it/commit/4c0af1eae1031c2630f6e29cc73f8a9dfac1081c">view</a> &bull; Fixed typo causing failure with mysql strict
* <a href="http://github.com/snipe/snipe-it/commit/0e3bcfecd05a39bfea6fc7ba11cb24d9d49e6d86">view</a> &bull; Should be final fixes for mysql strict mode
Regular → Executable
View File
Regular → Executable
+27 -222
View File
@@ -1,4 +1,5 @@
[![Click here to lend your support to: Snipe IT - Free Open Source Asset Management System and make a donation at pledgie.com](https://pledgie.com/campaigns/22899.png?skin_name=chrome)](https://pledgie.com/campaigns/22899) [![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=develop)](https://travis-ci.org/snipe/snipe-it)
[![Click here to lend your support to: Snipe IT - Free Open Source Asset Management System and make a donation at pledgie.com](https://pledgie.com/campaigns/22899.png?skin_name=chrome)](https://pledgie.com/campaigns/22899) [![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=develop)](https://travis-ci.org/snipe/snipe-it) [![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready&title=Ready)](http://waffle.io/snipe/snipe-it) [![ProjectStatus](http://stillmaintained.com/snipe/snipe-it.png)](http://stillmaintained.com/snipe/snipe-it)
## Snipe-IT - Asset Management For the Rest of Us
@@ -6,16 +7,34 @@ This is a FOSS project for asset management in IT Operations. Knowing who has wh
It is built on [Laravel 4.1](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package.
Many thanks to the [Laravel 4 starter site](https://github.com/brunogaspar/laravel4-starter-kit) for a quick start.
This project is being actively developed (at what seems like breakneck speed sometimes!) We're still in alpha release, so this is NOT recommended for production use yet, as many more things will likely change before v1.0-stable is ready - but we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](http://snipeitapp.com/demo.php).)
This project is being actively developed (at what seems like breakneck speed sometimes!) We're still in alpha release, so this is NOT recommended for production use yet, as many more things will likely change before v1.0-stable is ready - but we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases).
### Bug Reports and Feature Requests
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to check on progress, open a bug report, request a feature, or see what open issues you can help with.
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
-----
### Documentation & Installation
__Installation and configuration documentation for this project has been moved to http://docs.snipeitapp.com.__ This provides a more easily navigated, organized view of the documentation, and is based off of the [documentation branch](https://github.com/snipe/snipe-it/tree/documentation) in this repo. Contributions and bugfixes to the documentation are always welcome!
We'll be adding a long-overdue user's manual soon as well.
__To deploy on Ubuntu using Ansible and Vagrant, be sure to check out the [Snipe-IT Installation scripts](https://github.com/GR360RY/snipeit-ansible) created by [@GR360RY](https://github.com/GR360RY/).__
-----
### Bug Reports & Feature Requests
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open and closed) to see if your question hasn't already been answered before opening a new issue.
We use Waffle.io to help better communicate our roadmap with users. Our [project page there](http://waffle.io/snipe/snipe-it) will show you the backlog, what's ready to be worked on, what's in progress, and what's completed.
[![Stories in Ready](https://badge.waffle.io/snipe/snipe-it.png?label=ready&title=Ready)](http://waffle.io/snipe/snipe-it)
-----
### Announcement List
To be notified of important news (such as new releases, security advisories, etc), [sign up for our list](http://eepurl.com/XyZKz). We'll never sell or give away your info, and we'll only email you when it's important.
-----
## Requirements
- PHP 5.4 or later
@@ -23,7 +42,7 @@ Feel free to check out the [GitHub Issues for this project](https://github.com/s
-----
## Important Note on Updating
## Important Notes on Updating
Whenever you pull down a new version from master or develop, when you grab the [latest official release](https://github.com/snipe/snipe-it/releases), make sure to run the following commands via command line:
@@ -31,217 +50,3 @@ Whenever you pull down a new version from master or develop, when you grab the [
php artisan migrate
Forgetting to do this can mean your DB might end up out of sync with the new files you just pulled, or you may have some funky cached autoloader values. It's a good idea to get into the habit of running these every time you pull anything new down. If there are no database changes to migrate, it won't hurt anything to run migrations anyway.
-----
## How to Install
### 1) Downloading
#### 1.1) Clone the Repository
git clone https://github.com/snipe/snipe-it your-folder
#### 1.2) Download the Repository
https://github.com/snipe/snipe-it/archive/master.zip
-----
### 2) Setup Environment, Database and Mail Settings
#### 2.1) Adjust Environments
Update the file `boostrap/start.php` under the section `Detect The Application Environment`.
vi bootstrap/start.php
-----
__AS OF LARAVEL 4.1__
Per the [Laravel 4.1 upgrade docs](http://laravel.com/docs/upgrade):
__*"For security reasons, URL domains may no longer be used to detect your application environment. These values are easily spoofable and allow attackers to modify the environment for a request. You should convert your environment detection to use machine host names (hostname command on Mac & Ubuntu)."*__
To find out your local machine's hostname, type `hostname` from a terminal prompt on the machine you're installing it on. The command-line response is that machine's hostname. Please note that the hostname is NOT always the same as the domain name.
So for example, if you're installing this locally on your Mac named SnipeMBP, the environmental variable section of `bootstrap/start.php` might look like this:
$env = $app->detectEnvironment(array(
'local' => array('SnipeMBP'),
'staging' => array('staging.mysite.com'),
'production' => array('www.mysite.com')
));
If your development, staging and production sites all run on the same server (which is generally a terrible idea), [see this example](http://words.weareloring.com/development/setting-up-multiple-environments-in-laravel-4-1/) of how to configure the app using environmental variables.
-----
#### 2.2) Setup Your Database
Copy the example database config `app/config/local/database.example.php` to `app/config/local/database.php`.
Update the file `app/config/local/database.php` with your database name and credentials.
vi app/config/local/database.php
#### 2.3) Setup Mail Settings
Copy the example mail config `app/config/local/mail.example.php` to `app/config/local/mail.php`.
Update the file `app/config/local/mail.php` with your mail settings.
vi app/config/local/mail.php
This will be used to send emails to your users, when they register and they request a password reset.
#### 2.4) Adjust the application settings.
Copy the example app config `app/config/local/app.example.php` to `app/config/local/app.php`.
Update the file `app/config/local/app.php` with your URL settings.
vi app/config/local/app.php
You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root.
php artisan key:generate --env=local
#### 2.5) Additional Adjustments
The app is configured to automatically detect if you're in a local, staging, or production environment. Before deploying to a staging or production environment, follow sets 2.1, 2.2, and 2.3 above to tweak each environment as necessary. Configuration files for each environment can be found in app/config/{environment} (local, staging, and production).
-----
### 3) Install the Dependencies via Composer
##### 3.1) If you don't have composer installed globally
cd your-folder
curl -sS https://getcomposer.org/installer | php
php composer.phar install
##### 3.2) For global composer installations
cd your-folder
composer install
-----
### 4) Use custom CLI Installer Command
Now, you need to create yourself a user and finish the installation.
Use the following command to create your default user, user groups and run all the necessary migrations automatically.
php artisan app:install
-----
### 6) Fix permissions
You'll need to make sure that the `app/storage` directory is writable by your webserver, since caches and log files get written there. You should use the minimum permissions available for writing, based on how you've got your webserver configured.
chmod -R 755 app/storage
If you still run into a permissions error, you may need to increase the permissions to 775, or twiddle your user/group permissions on your server.
chmod -R 775 app/storage
-----
### 7) Set the correct document root for your server
The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack:
<VirtualHost *:80>
<Directory /var/www/html/public>
AllowOverride All
</Directory>
DocumentRoot /var/www/html/public
ServerName www.example.org
# Other directives here
</VirtualHost>
An OS X virtualhost setup could look more like:
Directory "/Users/flashingcursor/Sites/snipe-it/public/">
Allow From All
AllowOverride All
Options +Indexes
</Directory>
<VirtualHost *:80>
ServerName "snipe-it.dev"
DocumentRoot "/Users/flashingcursor/Sites/snipe-it/public"
SetEnv LARAVEL_ENV development
</VirtualHost>
-----
### 8) Seed the Database
Loading up the sample data will give you an idea of how this should look, how your info should be structured, etc. It only pre-loads a handful of items, so you won't have to spend an hour deleting sample data.
php artisan db:seed
-----
## Optional Development Stuff
### Set up the debugbar
In dev mode, I use the fabulous [Laravel Debugbar](https://github.com/barryvdh/laravel-debugbar) by @barryvdh. After you've installed/updated composer, you'll need to publish the assets for the debugbar:
php artisan debugbar:publish
The profiler is enabled by default if you have debug set to true in your app.php. You certainly don't have to use it, but it's pretty handy for troubleshooting queries, seeing how much memory your pages are using, etc.
-----
### Purging the autoloader
If you're doing any development on this, make sure you purge the auto-loader if you see any errors stating the new model you created can't be found, etc, otherwise your new models won't be grokked.
php composer.phar dump-autoload
-----
### Application logs
Application logs for this app are found in `app/storage/logs`, as is customary of Laravel.
-----
### Running this on an EC2 Micro Instance
Depending on your needs, you could probably run this system in an EC2 micro instance. It doesn't take up very much memory and typically won't be a super-high-traffic application. EC2 micros fall into the free/dirt-cheap tier, which might make this a nice option. One thing to note though - composer can be a little memory-intensive while you're running updates, and you may have trouble with it failing on a micro. You can crank the memory_limit up in php.ini, but EC2 micros have swap disabled by default, so even that may not cut it. If you run into totally unhelpful error messages while running composer updates (like simply 'Killed') or fatal memory issues mentioning phar, your best bet will be to enable swap:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
If you need more than 1024 then change that to something higher.
To enable it by default after reboot, add this line to /etc/fstab:
/var/swap.1 swap swap defaults 0 0
-----
## License
Copyright (C) 2013 Alison Gianotto - snipe@snipe.net
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
+274 -292
View File
@@ -4,341 +4,323 @@ use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class AppCommand extends Command {
class AppCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'app:install';
/**
* The console command name.
*
* @var string
*/
protected $name = 'app:install';
/**
* The console command description.
*
* @var string
*/
protected $description = '';
/**
* The console command description.
*
* @var string
*/
protected $description = '';
/**
* Holds the user information.
*
* @var array
*/
protected $userData = array(
'first_name' => null,
'last_name' => null,
'email' => null,
'password' => null
);
/**
* Holds the user information.
*
* @var array
*/
protected $userData = array(
'first_name' => null,
'last_name' => null,
'email' => null,
'password' => null
);
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->comment('=====================================');
$this->comment('');
$this->info(' Step: 1');
$this->comment('');
$this->info(' Please follow the following');
$this->info(' instructions to create your');
$this->info(' default user.');
$this->comment('');
$this->comment('-------------------------------------');
$this->comment('');
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->comment('=====================================');
$this->comment('');
$this->info(' Step: 1');
$this->comment('');
$this->info(' Please follow the following');
$this->info(' instructions to create your');
$this->info(' default user.');
$this->comment('');
$this->comment('-------------------------------------');
$this->comment('');
// Let's ask the user some questions, shall we?
$this->askUserFirstName();
$this->askUserLastName();
$this->askUserEmail();
$this->askUserPassword();
// Let's ask the user some questions, shall we?
$this->askUserFirstName();
$this->askUserLastName();
$this->askUserEmail();
$this->askUserPassword();
$this->comment('');
$this->comment('');
$this->comment('=====================================');
$this->comment('');
$this->info(' Step: 2');
$this->comment('');
$this->info(' Preparing your Application');
$this->comment('');
$this->comment('-------------------------------------');
$this->comment('');
$this->comment('');
$this->comment('');
$this->comment('=====================================');
$this->comment('');
$this->info(' Step: 2');
$this->comment('');
$this->info(' Preparing your Application');
$this->comment('');
$this->comment('-------------------------------------');
$this->comment('');
// Generate the Application Encryption key
$this->call('key:generate');
// Generate the Application Encryption key
$this->call('key:generate');
// Create the migrations table
$this->call('migrate:install');
// Create the migrations table
$this->call('migrate:install');
// Run the Sentry Migrations
$this->call('migrate', array('--package' => 'cartalyst/sentry'));
// Run the Sentry Migrations
$this->call('migrate', array('--package' => 'cartalyst/sentry'));
// Run the Migrations
$this->call('migrate');
// Run the Migrations
$this->call('migrate');
// Create the default user and default groups.
$this->sentryRunner();
// Create the default user and default groups.
$this->sentryRunner();
// Seed the tables with dummy data
$this->call('db:seed');
}
// Seed the tables with dummy data
$this->call('db:seed');
}
/**
* Asks the user for the first name.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserFirstName()
{
do
{
// Ask the user to input the first name
$first_name = $this->ask('Please enter your first name: ');
/**
* Asks the user for the first name.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserFirstName()
{
do {
// Ask the user to input the first name
$first_name = $this->ask('Please enter your first name: ');
// Check if the first name is valid
if ($first_name == '')
{
// Return an error message
$this->error('Your first name is invalid. Please try again.');
}
// Check if the first name is valid
if ($first_name == '') {
// Return an error message
$this->error('Your first name is invalid. Please try again.');
}
// Store the user first name
$this->userData['first_name'] = $first_name;
}
while( ! $first_name);
}
// Store the user first name
$this->userData['first_name'] = $first_name;
}
while( ! $first_name);
}
/**
* Asks the user for the last name.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserLastName()
{
do
{
// Ask the user to input the last name
$last_name = $this->ask('Please enter your last name: ');
/**
* Asks the user for the last name.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserLastName()
{
do {
// Ask the user to input the last name
$last_name = $this->ask('Please enter your last name: ');
// Check if the last name is valid.
if ($last_name == '')
{
// Return an error message
$this->error('Your last name is invalid. Please try again.');
}
// Check if the last name is valid.
if ($last_name == '') {
// Return an error message
$this->error('Your last name is invalid. Please try again.');
}
// Store the user last name
$this->userData['last_name'] = $last_name;
}
while( ! $last_name);
}
// Store the user last name
$this->userData['last_name'] = $last_name;
}
while( ! $last_name);
}
/**
* Asks the user for the user email address.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserEmail()
{
do
{
// Ask the user to input the email address
$email = $this->ask('Please enter your user email: ');
/**
* Asks the user for the user email address.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserEmail()
{
do {
// Ask the user to input the email address
$email = $this->ask('Please enter your user email: ');
// Check if email is valid
if ($email == '')
{
// Return an error message
$this->error('Email is invalid. Please try again.');
}
// Check if email is valid
if ($email == '') {
// Return an error message
$this->error('Email is invalid. Please try again.');
}
// Store the email address
$this->userData['email'] = $email;
}
while ( ! $email);
}
// Store the email address
$this->userData['email'] = $email;
}
while ( ! $email);
}
/**
* Asks the user for the user password.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserPassword()
{
do
{
// Ask the user to input the user password
$password = $this->ask('Please enter your user password (at least 8 characters): ');
/**
* Asks the user for the user password.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserPassword()
{
do {
// Ask the user to input the user password
$password = $this->ask('Please enter your user password (at least 8 characters): ');
// Check if email is valid
if ($password == '')
{
// Return an error message
$this->error('Password is invalid. Please try again.');
}
// Check if email is valid
if ($password == '') {
// Return an error message
$this->error('Password is invalid. Please try again.');
}
// Store the password
$this->userData['password'] = $password;
}
while( ! $password);
}
// Store the password
$this->userData['password'] = $password;
} while( ! $password);
}
/**
* Runs all the necessary Sentry commands.
*
* @return void
*/
protected function sentryRunner()
{
// Create the default groups
$this->sentryCreateDefaultGroups();
/**
* Runs all the necessary Sentry commands.
*
* @return void
*/
protected function sentryRunner()
{
// Create the default groups
$this->sentryCreateDefaultGroups();
// Create the user
$this->sentryCreateUser();
// Create the user
$this->sentryCreateUser();
// Create dummy user
$this->sentryCreateDummyUser();
}
// Create dummy user
$this->sentryCreateDummyUser();
}
/**
* Creates the default groups.
*
* @return void
*/
protected function sentryCreateDefaultGroups()
{
try
{
// Create the admin group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Admin',
'permissions' => array(
'admin' => 1,
'users' => 1
)
));
/**
* Creates the default groups.
*
* @return void
*/
protected function sentryCreateDefaultGroups()
{
try {
// Create the admin group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Admin',
'permissions' => array(
'admin' => 1,
'users' => 1
)
));
// Show the success message.
$this->comment('');
$this->info('Admin group created successfully.');
}
catch (Cartalyst\Sentry\Groups\GroupExistsException $e)
{
$this->error('Group already exists.');
}
// Show the success message.
$this->comment('');
$this->info('Admin group created successfully.');
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
$this->error('Group already exists.');
}
try
{
// Create the reporting group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Reporting',
'permissions' => array(
'admin' => 0,
'users' => 1
)
));
try {
// Create the reporting group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Reporting',
'permissions' => array(
'admin' => 0,
'users' => 1
)
));
// Show the success message.
$this->comment('');
$this->info('Reporting group created successfully.');
}
catch (Cartalyst\Sentry\Groups\GroupExistsException $e)
{
$this->error('Group already exists.');
}
// Show the success message.
$this->comment('');
$this->info('Reporting group created successfully.');
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
$this->error('Group already exists.');
}
try
{
// Create the general users group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Users',
'permissions' => array(
'admin' => 0,
'users' => 1
)
));
try {
// Create the general users group
$group = Sentry::getGroupProvider()->create(array(
'name' => 'Users',
'permissions' => array(
'admin' => 0,
'users' => 1
)
));
// Show the success message.
$this->comment('');
$this->info('Users group created successfully.');
}
catch (Cartalyst\Sentry\Groups\GroupExistsException $e)
{
$this->error('Group already exists.');
}
}
// Show the success message.
$this->comment('');
$this->info('Users group created successfully.');
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
$this->error('Group already exists.');
}
}
/**
* Create the user and associates the admin group to that user.
*
* @return void
*/
protected function sentryCreateUser()
{
// Prepare the user data array.
$data = array_merge($this->userData, array(
'activated' => 1,
'manager_id' => NULL,
'permissions' => array(
'admin' => 1,
'user' => 1,
),
));
/**
* Create the user and associates the admin group to that user.
*
* @return void
*/
protected function sentryCreateUser()
{
// Prepare the user data array.
$data = array_merge($this->userData, array(
'activated' => 1,
'manager_id' => NULL,
'permissions' => array(
'admin' => 1,
'user' => 1,
),
));
// Create the user
$user = Sentry::getUserProvider()->create($data);
// Create the user
$user = Sentry::getUserProvider()->create($data);
// Associate the Admin group to this user
$group = Sentry::getGroupProvider()->findById(1);
$user->addGroup($group);
// Associate the Admin group to this user
$group = Sentry::getGroupProvider()->findById(1);
$user->addGroup($group);
// Show the success message
$this->comment('');
$this->info('Your user was created successfully.');
$this->comment('');
}
// Show the success message
$this->comment('');
$this->info('Your user was created successfully.');
$this->comment('');
}
/**
* Create a dummy user.
*
* @return void
*/
protected function sentryCreateDummyUser()
{
// Prepare the user data array.
$data = array(
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'password' => 'johndoe',
'activated' => 1,
'manager_id' => 1,
);
/**
* Create a dummy user.
*
* @return void
*/
protected function sentryCreateDummyUser()
{
// Prepare the user data array.
$data = array(
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'password' => 'johndoe',
'activated' => 1,
'manager_id' => 1,
);
// Create the user
Sentry::getUserProvider()->create($data);
}
// Create the user
Sentry::getUserProvider()->create($data);
}
}
+124 -125
View File
@@ -2,144 +2,143 @@
return array(
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale
|--------------------------------------------------------------------------
|
| This locale ties into the languaage files in app/lang, which contain the
| language files for each translation.
|
*/
/*
|--------------------------------------------------------------------------
| Application Locale
|--------------------------------------------------------------------------
|
| This locale ties into the languaage files in app/lang, which contain the
| language files for each translation.
|
*/
'locale' => 'en',
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => array(
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Session\CommandsServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
'Illuminate\Log\LogServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Database\MigrationServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Remote\RemoteServiceProvider',
'Illuminate\Auth\Reminders\ReminderServiceProvider',
'Illuminate\Database\SeedServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider',
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Session\CommandsServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
'Illuminate\Log\LogServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Database\MigrationServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Remote\RemoteServiceProvider',
'Illuminate\Auth\Reminders\ReminderServiceProvider',
'Illuminate\Database\SeedServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Workbench\WorkbenchServiceProvider',
'Barryvdh\Debugbar\ServiceProvider',
'Cartalyst\Sentry\SentryServiceProvider',
'Chumper\Datatable\DatatableServiceProvider',
'Barryvdh\Debugbar\ServiceProvider',
'Cartalyst\Sentry\SentryServiceProvider',
'Chumper\Datatable\DatatableServiceProvider',
),
),
/*
|--------------------------------------------------------------------------
| Service Provider Manifest
|--------------------------------------------------------------------------
|
| The service provider manifest is used by Laravel to lazy load service
| providers which are not needed for each request, as well to keep a
| list of all of the services. Here, you may set its storage spot.
|
*/
/*
|--------------------------------------------------------------------------
| Service Provider Manifest
|--------------------------------------------------------------------------
|
| The service provider manifest is used by Laravel to lazy load service
| providers which are not needed for each request, as well to keep a
| list of all of the services. Here, you may set its storage spot.
|
*/
'manifest' => storage_path().'/meta',
'manifest' => storage_path().'/meta',
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => array(
'aliases' => array(
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'ClassLoader' => 'Illuminate\Support\ClassLoader',
'Config' => 'Illuminate\Support\Facades\Config',
'Controller' => 'Illuminate\Routing\Controller',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Form' => 'Illuminate\Support\Facades\Form',
'Hash' => 'Illuminate\Support\Facades\Hash',
'HTML' => 'Illuminate\Support\Facades\HTML',
'Input' => 'Illuminate\Support\Facades\Input',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Paginator' => 'Illuminate\Support\Facades\Paginator',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Seeder' => 'Illuminate\Database\Seeder',
'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
'Session' => 'Illuminate\Support\Facades\Session',
'SSH' => 'Illuminate\Support\Facades\SSH',
'Str' => 'Illuminate\Support\Str',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View'
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'ClassLoader' => 'Illuminate\Support\ClassLoader',
'Config' => 'Illuminate\Support\Facades\Config',
'Controller' => 'Illuminate\Routing\Controller',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Form' => 'Illuminate\Support\Facades\Form',
'Hash' => 'Illuminate\Support\Facades\Hash',
'HTML' => 'Illuminate\Support\Facades\HTML',
'Input' => 'Illuminate\Support\Facades\Input',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Paginator' => 'Illuminate\Support\Facades\Paginator',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Seeder' => 'Illuminate\Database\Seeder',
'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
'Session' => 'Illuminate\Support\Facades\Session',
'SSH' => 'Illuminate\Support\Facades\SSH',
'Str' => 'Illuminate\Support\Str',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View'
),
),
);
+48 -48
View File
@@ -2,62 +2,62 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This drivers manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This drivers manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
'driver' => 'eloquent',
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => 'User',
'model' => 'User',
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'table' => 'users',
'table' => 'users',
/*
|--------------------------------------------------------------------------
| Password Reminder Settings
|--------------------------------------------------------------------------
|
| Here you may set the settings for password reminders, including a view
| that should be used as your password reminder e-mail. You will also
| be able to set the name of the table that holds the reset tokens.
|
*/
/*
|--------------------------------------------------------------------------
| Password Reminder Settings
|--------------------------------------------------------------------------
|
| Here you may set the settings for password reminders, including a view
| that should be used as your password reminder e-mail. You will also
| be able to set the name of the table that holds the reset tokens.
|
*/
'reminder' => array(
'reminder' => array(
'email' => 'emails.auth.reminder', 'table' => 'password_reminders',
'email' => 'emails.auth.reminder', 'table' => 'password_reminders',
),
),
);
+70 -70
View File
@@ -2,88 +2,88 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Cache Driver
|--------------------------------------------------------------------------
|
| This option controls the default cache "driver" that will be used when
| using the Caching library. Of course, you may use other drivers any
| time you wish. This is the default when another is not specified.
|
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
*/
/*
|--------------------------------------------------------------------------
| Default Cache Driver
|--------------------------------------------------------------------------
|
| This option controls the default cache "driver" that will be used when
| using the Caching library. Of course, you may use other drivers any
| time you wish. This is the default when another is not specified.
|
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
*/
'driver' => 'file',
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| File Cache Location
|--------------------------------------------------------------------------
|
| When using the "file" cache driver, we need a location where the cache
| files may be stored. A sensible default has been specified, but you
| are free to change it to any other place on disk that you desire.
|
*/
/*
|--------------------------------------------------------------------------
| File Cache Location
|--------------------------------------------------------------------------
|
| When using the "file" cache driver, we need a location where the cache
| files may be stored. A sensible default has been specified, but you
| are free to change it to any other place on disk that you desire.
|
*/
'path' => storage_path().'/cache',
'path' => storage_path().'/cache',
/*
|--------------------------------------------------------------------------
| Database Cache Connection
|--------------------------------------------------------------------------
|
| When using the "database" cache driver you may specify the connection
| that should be used to store the cached items. When this option is
| null the default database connection will be utilized for cache.
|
*/
/*
|--------------------------------------------------------------------------
| Database Cache Connection
|--------------------------------------------------------------------------
|
| When using the "database" cache driver you may specify the connection
| that should be used to store the cached items. When this option is
| null the default database connection will be utilized for cache.
|
*/
'connection' => null,
'connection' => null,
/*
|--------------------------------------------------------------------------
| Database Cache Table
|--------------------------------------------------------------------------
|
| When using the "database" cache driver we need to know the table that
| should be used to store the cached items. A default table name has
| been provided but you're free to change it however you deem fit.
|
*/
/*
|--------------------------------------------------------------------------
| Database Cache Table
|--------------------------------------------------------------------------
|
| When using the "database" cache driver we need to know the table that
| should be used to store the cached items. A default table name has
| been provided but you're free to change it however you deem fit.
|
*/
'table' => 'cache',
'table' => 'cache',
/*
|--------------------------------------------------------------------------
| Memcached Servers
|--------------------------------------------------------------------------
|
| Now you may specify an array of your Memcached servers that should be
| used when utilizing the Memcached cache driver. All of the servers
| should contain a value for "host", "port", and "weight" options.
|
*/
/*
|--------------------------------------------------------------------------
| Memcached Servers
|--------------------------------------------------------------------------
|
| Now you may specify an array of your Memcached servers that should be
| used when utilizing the Memcached cache driver. All of the servers
| should contain a value for "host", "port", and "weight" options.
|
*/
'memcached' => array(
'memcached' => array(
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
),
),
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => 'laravel',
'prefix' => 'laravel',
);
+10 -10
View File
@@ -2,16 +2,16 @@
return array(
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
Regular → Executable
View File
Regular → Executable
+34 -34
View File
@@ -2,44 +2,44 @@
return array(
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => true,
'debug' => true,
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://snipe-it-laravel.local:8888',
'url' => 'http://snipe-it-laravel.local:8888',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
'key' => 'Change_this_key_or_snipe_will_get_ya',
);
+101 -101
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'snipeit_laravel',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'snipeit_laravel',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
),
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => array(
'redis' => array(
'cluster' => true,
'cluster' => true,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
),
);
+102 -102
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
'driver' => 'smtp',
'driver' => 'smtp',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
'host' => 'smtp.mailgun.org',
'host' => 'smtp.mailgun.org',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
'port' => 587,
'port' => 587,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => null, 'name' => null),
'from' => array('address' => null, 'name' => null),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => null,
'username' => null,
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => null,
'password' => null,
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
'pretend' => false,
);
);
+146
View File
@@ -0,0 +1,146 @@
<?php
use Illuminate\Support\Facades\Config;
return array(
/*
|--------------------------------------------------------------------------
| Debugbar Settings
|--------------------------------------------------------------------------
|
| Debugbar is enabled by default, when debug is set to true in app.php.
|
*/
'enabled' => Config::get('app.debug'),
/*
|--------------------------------------------------------------------------
| Storage settings
|--------------------------------------------------------------------------
|
| DebugBar stores data for session/ajax requests in a directory.
| You can disable this, so the debugbar stores data in headers/session,
| but this can cause problems with large data collectors.
|
*/
'storage' => array(
'enabled' => true,
'path' => storage_path() . '/debugbar',
),
/*
|--------------------------------------------------------------------------
| Vendors
|--------------------------------------------------------------------------
|
| Vendor files are included by default, but can be set to false.
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
| and for js: jquery and and highlight.js
| So if you want syntax highlighting, set it to true.
| jQuery is set to not conflict with existing jQuery scripts.
|
*/
'include_vendors' => true,
/*
|--------------------------------------------------------------------------
| Capture Ajax Requests
|--------------------------------------------------------------------------
|
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers.
|
*/
'capture_ajax' => true,
/*
|--------------------------------------------------------------------------
| Capture Console Commands
|--------------------------------------------------------------------------
|
| The Debugbar can listen to Artisan commands. You can view them with the browse button in the Debugbar.
|
*/
'capture_console' => false,
/*
|--------------------------------------------------------------------------
| DataCollectors
|--------------------------------------------------------------------------
|
| Enable/disable DataCollectors
|
*/
'collectors' => array(
'phpinfo' => true, // Php version
'messages' => true, // Messages
'time' => true, // Time Datalogger
'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data
'route' => true, // Current route information
'laravel' => false, // Laravel version and environment
'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
),
/*
|--------------------------------------------------------------------------
| Extra options
|--------------------------------------------------------------------------
|
| Configure some DataCollectors
|
*/
'options' => array(
'auth' => array(
'show_name' => false, // Also show the users name/email in the debugbar
),
'db' => array(
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline
),
'mail' => array(
'full_log' => false
),
'views' => array(
'data' => false, //Note: Can slow down the application, because the data can be quite large..
),
'route' => array(
'label' => true // show complete route on bar
),
'logs' => array(
'file' => null
),
),
/*
|--------------------------------------------------------------------------
| Inject Debugbar in Response
|--------------------------------------------------------------------------
|
| Usually, the debugbar is added just before <body>, by listening to the
| Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
*/
'inject' => true,
);
@@ -42,12 +42,38 @@ return array(
|
| This option allows you to specify the default hasher used by Sentry
|
| Supported: "native", "bcrypt", "sha256"
| Supported: "native", "bcrypt", "sha256", "whirlpool"
|
*/
'hasher' => 'native',
/*
|--------------------------------------------------------------------------
| Cookie
|--------------------------------------------------------------------------
|
| Configuration specific to the cookie component of Sentry.
|
*/
'cookie' => array(
/*
|--------------------------------------------------------------------------
| Default Cookie Key
|--------------------------------------------------------------------------
|
| This option allows you to specify the default cookie key used by Sentry.
|
| Supported: string
|
*/
'key' => 'cartalyst_sentry',
),
/*
|--------------------------------------------------------------------------
| Groups
@@ -56,6 +82,7 @@ return array(
| Configuration specific to the group management component of Sentry.
|
*/
'groups' => array(
/*
@@ -80,6 +107,7 @@ return array(
| Configuration specific to the user management component of Sentry.
|
*/
'users' => array(
/*
@@ -92,6 +120,7 @@ return array(
|
*/
//'model' => 'Cartalyst\Sentry\Users\Eloquent\User',
'model' => 'User',
/*
@@ -99,9 +128,9 @@ return array(
| Login Attribute
|--------------------------------------------------------------------------
|
| If you're the "eloquent" driver and extending the base Eloquent model,
| we allow you to globally override the login attribute without even
| subclassing the model, simply by specifying the attribute below.
| If you're using the "eloquent" driver and extending the base Eloquent
| model, we allow you to globally override the login attribute without
| even subclassing the model, simply by specifying the attribute below.
|
*/
@@ -109,6 +138,20 @@ return array(
),
/*
|--------------------------------------------------------------------------
| User Groups Pivot Table
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver, you can specify the table name
| for the user groups pivot table.
|
| Default: users_groups
|
*/
'user_groups_pivot_table' => 'users_groups',
/*
|--------------------------------------------------------------------------
| Throttling
@@ -118,6 +161,7 @@ return array(
| enables limiting of login attempts and the suspension & banning of users.
|
*/
'throttling' => array(
/*
+12 -12
View File
@@ -2,18 +2,18 @@
return array(
'Global' => array(
array(
'permission' => 'superuser',
'label' => 'Super User',
),
),
'Global' => array(
array(
'permission' => 'superuser',
'label' => 'Super User',
),
),
'Admin' => array(
array(
'permission' => 'admin',
'label' => 'Admin Rights',
),
),
'Admin' => array(
array(
'permission' => 'admin',
'label' => 'Admin Rights',
),
),
);
Regular → Executable
View File
+34 -34
View File
@@ -2,44 +2,44 @@
return array(
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => false,
'debug' => true,
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://www.yourserver.com',
'url' => 'http://staging.yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
'key' => 'Change_this_key_or_snipe_will_get_ya',
);
+101 -101
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'travis',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'travis',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
),
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => array(
'redis' => array(
'cluster' => true,
'cluster' => true,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
),
);
+102 -102
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
'driver' => 'smtp',
'driver' => 'smtp',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
'host' => 'smtp.mailgun.org',
'host' => 'smtp.mailgun.org',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
'port' => 587,
'port' => 587,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => null, 'name' => null),
'from' => array('address' => null, 'name' => null),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => null,
'username' => null,
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => null,
'password' => null,
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
'pretend' => false,
);
);
+49 -49
View File
@@ -2,63 +2,63 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Queue Driver
|--------------------------------------------------------------------------
|
| The Laravel queue API supports a variety of back-ends via an unified
| API, giving you convenient access to each back-end using the same
| syntax for each one. Here you may set the default queue driver.
|
| Supported: "sync", "beanstalkd", "sqs", "iron"
|
*/
/*
|--------------------------------------------------------------------------
| Default Queue Driver
|--------------------------------------------------------------------------
|
| The Laravel queue API supports a variety of back-ends via an unified
| API, giving you convenient access to each back-end using the same
| syntax for each one. Here you may set the default queue driver.
|
| Supported: "sync", "beanstalkd", "sqs", "iron"
|
*/
'default' => 'sync',
'default' => 'sync',
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
*/
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
*/
'connections' => array(
'connections' => array(
'sync' => array(
'driver' => 'sync',
),
'sync' => array(
'driver' => 'sync',
),
'beanstalkd' => array(
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
),
'beanstalkd' => array(
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
),
'sqs' => array(
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'queue' => 'your-queue-url',
'region' => 'us-east-1',
),
'sqs' => array(
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'queue' => 'your-queue-url',
'region' => 'us-east-1',
),
'iron' => array(
'driver' => 'iron',
'project' => 'your-project-id',
'token' => 'your-token',
'queue' => 'your-queue-name',
),
'iron' => array(
'driver' => 'iron',
'project' => 'your-project-id',
'token' => 'your-token',
'queue' => 'your-queue-name',
),
'failed' => array(
'database' => 'mysql', 'table' => 'failed_jobs',
),
'failed' => array(
'database' => 'mysql', 'table' => 'failed_jobs',
),
),
),
);
Regular → Executable
+45 -45
View File
@@ -2,58 +2,58 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Remote Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify the default connection that will be used for SSH
| operations. This name should correspond to a connection name below
| in the server list. Each connection will be manually accessible.
|
*/
/*
|--------------------------------------------------------------------------
| Default Remote Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify the default connection that will be used for SSH
| operations. This name should correspond to a connection name below
| in the server list. Each connection will be manually accessible.
|
*/
'default' => 'production',
'default' => 'production',
/*
|--------------------------------------------------------------------------
| Remote Server Connections
|--------------------------------------------------------------------------
|
| These are the servers that will be accessible via the SSH task runner
| facilities of Laravel. This feature radically simplifies executing
| tasks on your servers, such as deploying out these applications.
|
*/
/*
|--------------------------------------------------------------------------
| Remote Server Connections
|--------------------------------------------------------------------------
|
| These are the servers that will be accessible via the SSH task runner
| facilities of Laravel. This feature radically simplifies executing
| tasks on your servers, such as deploying out these applications.
|
*/
'connections' => array(
'connections' => array(
'production' => array(
'host' => '',
'username' => '',
'password' => '',
'key' => '',
'keyphrase' => '',
'root' => '/var/www',
),
'production' => array(
'host' => '',
'username' => '',
'password' => '',
'key' => '',
'keyphrase' => '',
'root' => '/var/www',
),
),
),
/*
|--------------------------------------------------------------------------
| Remote Server Groups
|--------------------------------------------------------------------------
|
| Here you may list connections under a single group name, which allows
| you to easily access all of the servers at once using a short name
| that is extremely easy to remember, such as "web" or "database".
|
*/
/*
|--------------------------------------------------------------------------
| Remote Server Groups
|--------------------------------------------------------------------------
|
| Here you may list connections under a single group name, which allows
| you to easily access all of the servers at once using a short name
| that is extremely easy to remember, such as "web" or "database".
|
*/
'groups' => array(
'groups' => array(
'web' => array('production')
'web' => array('production')
),
),
);
);
+103 -103
View File
@@ -2,126 +2,126 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "native", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "native", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'native',
'driver' => 'native',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle for it is expired. If you want them
| to immediately expire when the browser closes, set it to zero.
|
*/
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle for it is expired. If you want them
| to immediately expire when the browser closes, set it to zero.
|
*/
'lifetime' => 120,
'lifetime' => 120,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the database
| connection that should be used to manage your sessions. This should
| correspond to a connection in your "database" configuration file.
|
*/
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the database
| connection that should be used to manage your sessions. This should
| correspond to a connection in your "database" configuration file.
|
*/
'connection' => null,
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'laravel_session',
'cookie' => 'laravel_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
'domain' => null,
'expire_on_close' => false,
'expire_on_close' => false,
);
Regular → Executable
View File
+34 -34
View File
@@ -2,44 +2,44 @@
return array(
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => true,
'debug' => true,
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://staging.yourserver.com',
'url' => 'http://staging.yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
'key' => 'Change_this_key_or_snipe_will_get_ya',
);
+101 -101
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'snipeit_laravel',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_laravel',
'username' => 'snipeit_laravel',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
),
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => array(
'redis' => array(
'cluster' => true,
'cluster' => true,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
),
);
+102 -102
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
'driver' => 'smtp',
'driver' => 'smtp',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
'host' => 'smtp.mailgun.org',
'host' => 'smtp.mailgun.org',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
'port' => 587,
'port' => 587,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => null, 'name' => null),
'from' => array('address' => null, 'name' => null),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => null,
'username' => null,
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => null,
'password' => null,
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
'pretend' => false,
);
);
+34 -34
View File
@@ -2,44 +2,44 @@
return array(
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => true,
'debug' => true,
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://staging.yourserver.com',
'url' => 'http://staging.yourserver.com',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => 'Change_this_key_or_snipe_will_get_ya',
'key' => 'Change_this_key_or_snipe_will_get_ya',
);
+14 -14
View File
@@ -2,19 +2,19 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Cache Driver
|--------------------------------------------------------------------------
|
| This option controls the default cache "driver" that will be used when
| using the Caching library. Of course, you may use other drivers any
| time you wish. This is the default when another is not specified.
|
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
*/
/*
|--------------------------------------------------------------------------
| Default Cache Driver
|--------------------------------------------------------------------------
|
| This option controls the default cache "driver" that will be used when
| using the Caching library. Of course, you may use other drivers any
| time you wish. This is the default when another is not specified.
|
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
*/
'driver' => 'array',
'driver' => 'array',
);
);
+68 -68
View File
@@ -2,90 +2,90 @@
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'sqlite',
'default' => 'sqlite',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => ''
),
),
),
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => array(
'redis' => array(
'cluster' => true,
'cluster' => true,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
),
);
+102 -102
View File
@@ -2,123 +2,123 @@
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail"
|
*/
'driver' => 'smtp',
'driver' => 'smtp',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Postmark mail service, which will provide reliable delivery.
|
*/
'host' => 'smtp.mailgun.org',
'host' => 'smtp.mailgun.org',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to delivery e-mails to
| users of your application. Like the host we have set this value to
| stay compatible with the Postmark e-mail application by default.
|
*/
'port' => 587,
'port' => 587,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => null, 'name' => null),
'from' => array('address' => null, 'name' => null),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => null,
'username' => null,
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => null,
'password' => null,
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
'pretend' => false,
);
);
+15 -15
View File
@@ -2,20 +2,20 @@
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "native", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "native", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'array',
'driver' => 'array',
);
);
+22 -22
View File
@@ -2,30 +2,30 @@
return array(
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => array(__DIR__.'/../views'),
'paths' => array(__DIR__.'/../views'),
/*
|--------------------------------------------------------------------------
| Pagination View
|--------------------------------------------------------------------------
|
| This view will be used to render the pagination link output, and can
| be easily customized here to show any view you like. A clean view
| compatible with Twitter's Bootstrap is given to you by default.
|
*/
/*
|--------------------------------------------------------------------------
| Pagination View
|--------------------------------------------------------------------------
|
| This view will be used to render the pagination link output, and can
| be easily customized here to show any view you like. A clean view
| compatible with Twitter's Bootstrap is given to you by default.
|
*/
'pagination' => 'paginator/slider',
'pagination' => 'paginator/slider',
);
+22 -22
View File
@@ -2,30 +2,30 @@
return array(
/*
|--------------------------------------------------------------------------
| Workbench Author Name
|--------------------------------------------------------------------------
|
| When you create new packages via the Artisan "workbench" command your
| name is needed to generate the composer.json file for your package.
| You may specify it now so it is used for all of your workbenches.
|
*/
/*
|--------------------------------------------------------------------------
| Workbench Author Name
|--------------------------------------------------------------------------
|
| When you create new packages via the Artisan "workbench" command your
| name is needed to generate the composer.json file for your package.
| You may specify it now so it is used for all of your workbenches.
|
*/
'name' => '',
'name' => '',
/*
|--------------------------------------------------------------------------
| Workbench Author E-Mail Address
|--------------------------------------------------------------------------
|
| Like the option above, your e-mail address is used when generating new
| workbench packages. The e-mail is placed in your composer.json file
| automatically after the package is created by the workbench tool.
|
*/
/*
|--------------------------------------------------------------------------
| Workbench Author E-Mail Address
|--------------------------------------------------------------------------
|
| Like the option above, your e-mail address is used when generating new
| workbench packages. The e-mail is placed in your composer.json file
| automatically after the package is created by the workbench tool.
|
*/
'email' => '',
'email' => '',
);
+67 -73
View File
@@ -1,88 +1,82 @@
<?php
class AdminController extends AuthorizedController {
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// Apply the admin auth filter
$this->beforeFilter('admin-auth');
}
class AdminController extends AuthorizedController
{
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// Apply the admin auth filter
$this->beforeFilter('admin-auth');
}
/**
* Encodes the permissions so that they are form friendly.
*
* @param array $permissions
* @param bool $removeSuperUser
* @return void
*/
protected function encodeAllPermissions(array &$allPermissions, $removeSuperUser = false)
{
foreach ($allPermissions as $area => &$permissions)
{
foreach ($permissions as $index => &$permission)
{
if ($removeSuperUser == true and $permission['permission'] == 'superuser')
{
unset($permissions[$index]);
continue;
}
/**
* Encodes the permissions so that they are form friendly.
*
* @param array $permissions
* @param bool $removeSuperUser
* @return void
*/
protected function encodeAllPermissions(array &$allPermissions, $removeSuperUser = false)
{
foreach ($allPermissions as $area => &$permissions) {
foreach ($permissions as $index => &$permission) {
if ($removeSuperUser == true and $permission['permission'] == 'superuser') {
unset($permissions[$index]);
continue;
}
$permission['can_inherit'] = ($permission['permission'] != 'superuser');
$permission['permission'] = base64_encode($permission['permission']);
}
$permission['can_inherit'] = ($permission['permission'] != 'superuser');
$permission['permission'] = base64_encode($permission['permission']);
}
// If we removed a super user permission and there are
// none left, let's remove the group
if ($removeSuperUser == true and empty($permissions))
{
unset($allPermissions[$area]);
}
}
}
// If we removed a super user permission and there are
// none left, let's remove the group
if ($removeSuperUser == true and empty($permissions)) {
unset($allPermissions[$area]);
}
}
}
/**
* Encodes user permissions to match that of the encoded "all"
* permissions above.
*
* @param array $permissions
* @return void
*/
protected function encodePermissions(array &$permissions)
{
$encodedPermissions = array();
/**
* Encodes user permissions to match that of the encoded "all"
* permissions above.
*
* @param array $permissions
* @return void
*/
protected function encodePermissions(array &$permissions)
{
$encodedPermissions = array();
foreach ($permissions as $permission => $access)
{
$encodedPermissions[base64_encode($permission)] = $access;
}
foreach ($permissions as $permission => $access) {
$encodedPermissions[base64_encode($permission)] = $access;
}
$permissions = $encodedPermissions;
}
$permissions = $encodedPermissions;
}
/**
* Decodes user permissions to match that of the encoded "all"
* permissions above.
*
* @param array $permissions
* @return void
*/
protected function decodePermissions(array &$permissions)
{
$decodedPermissions = array();
/**
* Decodes user permissions to match that of the encoded "all"
* permissions above.
*
* @param array $permissions
* @return void
*/
protected function decodePermissions(array &$permissions)
{
$decodedPermissions = array();
foreach ($permissions as $permission => $access)
{
$decodedPermissions[base64_decode($permission)] = $access;
}
foreach ($permissions as $permission => $access) {
$decodedPermissions[base64_decode($permission)] = $access;
}
$permissions = $decodedPermissions;
}
$permissions = $decodedPermissions;
}
}
+262 -299
View File
@@ -1,344 +1,307 @@
<?php
class AuthController extends BaseController {
class AuthController extends BaseController
{
/**
* Account sign in.
*
* @return View
*/
public function getSignin()
{
// Is the user logged in?
if (Sentry::check()) {
return Redirect::route('account');
}
/**
* Account sign in.
*
* @return View
*/
public function getSignin()
{
// Is the user logged in?
if (Sentry::check())
{
return Redirect::route('account');
}
// Show the page
return View::make('frontend.auth.signin');
}
// Show the page
return View::make('frontend.auth.signin');
}
/**
* Account sign in form processing.
*
* @return Redirect
*/
public function postSignin()
{
// Declare the rules for the form validation
$rules = array(
'email' => 'required|email',
'password' => 'required',
);
/**
* Account sign in form processing.
*
* @return Redirect
*/
public function postSignin()
{
// Declare the rules for the form validation
$rules = array(
'email' => 'required|email',
'password' => 'required',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Try to log the user in
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
try
{
// Try to log the user in
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
// Get the page we were before
$redirect = Session::get('loginRedirect', 'account');
// Get the page we were before
$redirect = Session::get('loginRedirect', 'account');
// Unset the page we were before from the session
Session::forget('loginRedirect');
// Unset the page we were before from the session
Session::forget('loginRedirect');
// Redirect to the users page
return Redirect::to($redirect)->with('success', Lang::get('auth/message.signin.success'));
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
}
// Redirect to the users page
return Redirect::to($redirect)->with('success', Lang::get('auth/message.signin.success'));
}
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
{
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
}
catch (Cartalyst\Sentry\Users\UserNotActivatedException $e)
{
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
}
catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e)
{
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
}
catch (Cartalyst\Sentry\Throttling\UserBannedException $e)
{
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* Account sign up.
*
* @return View
*/
public function getSignup()
{
// Is the user logged in?
if (Sentry::check()) {
return Redirect::route('account');
}
/**
* Account sign up.
*
* @return View
*/
public function getSignup()
{
// Is the user logged in?
if (Sentry::check())
{
return Redirect::route('account');
}
// Show the page
return View::make('frontend.auth.signup');
}
// Show the page
return View::make('frontend.auth.signup');
}
/**
* Account sign up form processing.
*
* @return Redirect
*/
public function postSignup()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:2',
'last_name' => 'required|min:2',
'email' => 'required|email|unique:users',
'email_confirm' => 'required|email|same:email',
'password' => 'required|between:10,32',
'password_confirm' => 'required|same:password',
);
/**
* Account sign up form processing.
*
* @return Redirect
*/
public function postSignup()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:2',
'last_name' => 'required|min:2',
'email' => 'required|email|unique:users',
'email_confirm' => 'required|email|same:email',
'password' => 'required|between:8,32',
'password_confirm' => 'required|same:password',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Register the user
$user = Sentry::register(array(
'first_name' => Input::get('first_name'),
'last_name' => Input::get('last_name'),
'email' => Input::get('email'),
'password' => Input::get('password'),
));
try
{
// Register the user
$user = Sentry::register(array(
'first_name' => Input::get('first_name'),
'last_name' => Input::get('last_name'),
'email' => Input::get('email'),
'password' => Input::get('password'),
));
// Data to be used on the email view
$data = array(
'user' => $user,
'activationUrl' => URL::route('activate', $user->getActivationCode()),
);
// Data to be used on the email view
$data = array(
'user' => $user,
'activationUrl' => URL::route('activate', $user->getActivationCode()),
);
// Send the activation code through email
Mail::send('emails.register-activate', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Welcome ' . $user->first_name);
});
// Send the activation code through email
Mail::send('emails.register-activate', $data, function($m) use ($user)
{
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Welcome ' . $user->first_name);
});
// Redirect to the register page
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
} catch (Cartalyst\Sentry\Users\UserExistsException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
}
// Redirect to the register page
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
}
catch (Cartalyst\Sentry\Users\UserExistsException $e)
{
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* User account activation page.
*
* @param string $actvationCode
* @return
*/
public function getActivate($activationCode = null)
{
// Is the user logged in?
if (Sentry::check()) {
return Redirect::route('account');
}
/**
* User account activation page.
*
* @param string $actvationCode
* @return
*/
public function getActivate($activationCode = null)
{
// Is the user logged in?
if (Sentry::check())
{
return Redirect::route('account');
}
try {
// Get the user we are trying to activate
$user = Sentry::getUserProvider()->findByActivationCode($activationCode);
try
{
// Get the user we are trying to activate
$user = Sentry::getUserProvider()->findByActivationCode($activationCode);
// Try to activate this user account
if ($user->attemptActivation($activationCode)) {
// Redirect to the login page
return Redirect::route('signin')->with('success', Lang::get('auth/message.activate.success'));
}
// Try to activate this user account
if ($user->attemptActivation($activationCode))
{
// Redirect to the login page
return Redirect::route('signin')->with('success', Lang::get('auth/message.activate.success'));
}
// The activation failed.
$error = Lang::get('auth/message.activate.error');
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
$error = Lang::get('auth/message.activate.error');
}
// The activation failed.
$error = Lang::get('auth/message.activate.error');
}
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
{
$error = Lang::get('auth/message.activate.error');
}
// Ooops.. something went wrong
return Redirect::route('signin')->with('error', $error);
}
// Ooops.. something went wrong
return Redirect::route('signin')->with('error', $error);
}
/**
* Forgot password page.
*
* @return View
*/
public function getForgotPassword()
{
// Show the page
return View::make('frontend.auth.forgot-password');
}
/**
* Forgot password page.
*
* @return View
*/
public function getForgotPassword()
{
// Show the page
return View::make('frontend.auth.forgot-password');
}
/**
* Forgot password form processing page.
*
* @return Redirect
*/
public function postForgotPassword()
{
// Declare the rules for the validator
$rules = array(
'email' => 'required|email',
);
/**
* Forgot password form processing page.
*
* @return Redirect
*/
public function postForgotPassword()
{
// Declare the rules for the validator
$rules = array(
'email' => 'required|email',
);
// Create a new validator instance from our dynamic rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our dynamic rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::route('forgot-password')->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::route('forgot-password')->withInput()->withErrors($validator);
}
try {
// Get the user password recovery code
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
try
{
// Get the user password recovery code
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
// Data to be used on the email view
$data = array(
'user' => $user,
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $user->getResetPasswordCode()),
);
// Data to be used on the email view
$data = array(
'user' => $user,
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $user->getResetPasswordCode()),
);
// Send the activation code through email
Mail::send('emails.forgot-password', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Account Password Recovery');
});
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Even though the email was not found, we will pretend
// we have sent the password reset code through email,
// this is a security measure against hackers.
}
// Send the activation code through email
Mail::send('emails.forgot-password', $data, function($m) use ($user)
{
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Account Password Recovery');
});
}
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
{
// Even though the email was not found, we will pretend
// we have sent the password reset code through email,
// this is a security measure against hackers.
}
// Redirect to the forgot password
return Redirect::route('forgot-password')->with('success', Lang::get('auth/message.forgot-password.success'));
}
// Redirect to the forgot password
return Redirect::route('forgot-password')->with('success', Lang::get('auth/message.forgot-password.success'));
}
/**
* Forgot Password Confirmation page.
*
* @param string $passwordResetCode
* @return View
*/
public function getForgotPasswordConfirm($passwordResetCode = null)
{
try {
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
} catch(Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Redirect to the forgot password page
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
/**
* Forgot Password Confirmation page.
*
* @param string $passwordResetCode
* @return View
*/
public function getForgotPasswordConfirm($passwordResetCode = null)
{
try
{
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
}
catch(Cartalyst\Sentry\Users\UserNotFoundException $e)
{
// Redirect to the forgot password page
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
// Show the page
return View::make('frontend.auth.forgot-password-confirm');
}
// Show the page
return View::make('frontend.auth.forgot-password-confirm');
}
/**
* Forgot Password Confirmation form processing page.
*
* @param string $passwordResetCode
* @return Redirect
*/
public function postForgotPasswordConfirm($passwordResetCode = null)
{
// Declare the rules for the form validation
$rules = array(
'password' => 'required|between:10,32',
'password_confirm' => 'required|same:password'
);
/**
* Forgot Password Confirmation form processing page.
*
* @param string $passwordResetCode
* @return Redirect
*/
public function postForgotPasswordConfirm($passwordResetCode = null)
{
// Declare the rules for the form validation
$rules = array(
'password' => 'required|between:8,32',
'password_confirm' => 'required|same:password'
);
// Create a new validator instance from our dynamic rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our dynamic rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::route('forgot-password-confirm', $passwordResetCode)->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::route('forgot-password-confirm', $passwordResetCode)->withInput()->withErrors($validator);
}
try {
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
try
{
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
// Attempt to reset the user password
if ($user->attemptResetPassword($passwordResetCode, Input::get('password'))) {
// Password successfully reseted
return Redirect::route('signin')->with('success', Lang::get('auth/message.forgot-password-confirm.success'));
} else {
// Ooops.. something went wrong
return Redirect::route('signin')->with('error', Lang::get('auth/message.forgot-password-confirm.error'));
}
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Redirect to the forgot password page
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
}
// Attempt to reset the user password
if ($user->attemptResetPassword($passwordResetCode, Input::get('password')))
{
// Password successfully reseted
return Redirect::route('signin')->with('success', Lang::get('auth/message.forgot-password-confirm.success'));
}
else
{
// Ooops.. something went wrong
return Redirect::route('signin')->with('error', Lang::get('auth/message.forgot-password-confirm.error'));
}
}
catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
{
// Redirect to the forgot password page
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
}
/**
* Logout page.
*
* @return Redirect
*/
public function getLogout()
{
// Log the user out
Sentry::logout();
/**
* Logout page.
*
* @return Redirect
*/
public function getLogout()
{
// Log the user out
Sentry::logout();
// Redirect to the users page
return Redirect::route('home')->with('success', 'You have successfully logged out!');
}
// Redirect to the users page
return Redirect::route('home')->with('success', 'You have successfully logged out!');
}
}
+20 -20
View File
@@ -1,26 +1,26 @@
<?php
class AuthorizedController extends BaseController {
class AuthorizedController extends BaseController
{
/**
* Whitelisted auth routes.
*
* @var array
*/
protected $whitelist = array();
/**
* Whitelisted auth routes.
*
* @var array
*/
protected $whitelist = array();
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// Apply the auth filter
$this->beforeFilter('auth', array('except' => $this->whitelist));
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// Apply the auth filter
$this->beforeFilter('auth', array('except' => $this->whitelist));
// Call parent
parent::__construct();
}
// Call parent
parent::__construct();
}
}
+31 -32
View File
@@ -1,39 +1,38 @@
<?php
class BaseController extends Controller {
class BaseController extends Controller
{
/**
* Message bag.
*
* @var Illuminate\Support\MessageBag
*/
protected $messageBag = null;
/**
* Message bag.
*
* @var Illuminate\Support\MessageBag
*/
protected $messageBag = null;
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// CSRF Protection
$this->beforeFilter('csrf', array('on' => 'post'));
/**
* Initializer.
*
* @return void
*/
public function __construct()
{
// CSRF Protection
$this->beforeFilter('csrf', array('on' => 'post'));
//
$this->messageBag = new Illuminate\Support\MessageBag;
}
//
$this->messageBag = new Illuminate\Support\MessageBag;
}
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if ( ! is_null($this->layout))
{
$this->layout = View::make($this->layout);
}
}
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if ( ! is_null($this->layout)) {
$this->layout = View::make($this->layout);
}
}
}
+19 -19
View File
@@ -1,23 +1,23 @@
<?php
class HomeController extends BaseController {
class HomeController extends BaseController
{
/*
|--------------------------------------------------------------------------
| Default Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| based routes. That's great! Here is an example controller method to
| get you started. To route to this controller, just add the route:
|
| Route::get('/', 'HomeController@showWelcome');
|
*/
/*
|--------------------------------------------------------------------------
| Default Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| based routes. That's great! Here is an example controller method to
| get you started. To route to this controller, just add the route:
|
| Route::get('/', 'HomeController@showWelcome');
|
*/
public function showWelcome()
{
return View::make('hello');
}
public function showWelcome()
{
return View::make('hello');
}
}
}
@@ -7,65 +7,63 @@ use Sentry;
use Validator;
use View;
class ChangeEmailController extends AuthorizedController {
class ChangeEmailController extends AuthorizedController
{
/**
* User change email page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
/**
* User change email page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
// Show the page
return View::make('frontend/account/change-email', compact('user'));
}
// Show the page
return View::make('frontend/account/change-email', compact('user'));
}
/**
* Users change email form processing page.
*
* @return Redirect
*/
public function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'current_password' => 'required|between:3,32',
'email' => 'required|email|unique:users,email,'.Sentry::getUser()->email.',email',
'email_confirm' => 'required|same:email',
);
/**
* Users change email form processing page.
*
* @return Redirect
*/
public function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'current_password' => 'required|between:3,32',
'email' => 'required|email|unique:users,email,'.Sentry::getUser()->email.',email',
'email_confirm' => 'required|same:email',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Grab the user
$user = Sentry::getUser();
// Grab the user
$user = Sentry::getUser();
// Check the user current password
if ( ! $user->checkPassword(Input::get('current_password'))) {
// Set the error message
$this->messageBag->add('current_password', 'Your current password is incorrect');
// Check the user current password
if ( ! $user->checkPassword(Input::get('current_password')))
{
// Set the error message
$this->messageBag->add('current_password', 'Your current password is incorrect');
// Redirect to the change email page
return Redirect::route('change-email')->withErrors($this->messageBag);
}
// Redirect to the change email page
return Redirect::route('change-email')->withErrors($this->messageBag);
}
// Update the user email
$user->email = Input::get('email');
$user->save();
// Update the user email
$user->email = Input::get('email');
$user->save();
// Redirect to the settings page
return Redirect::route('change-email')->with('success', 'Email successfully updated');
}
// Redirect to the settings page
return Redirect::route('change-email')->with('success', 'Email successfully updated');
}
}
@@ -7,65 +7,63 @@ use Sentry;
use Validator;
use View;
class ChangePasswordController extends AuthorizedController {
class ChangePasswordController extends AuthorizedController
{
/**
* User change password page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
/**
* User change password page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
// Show the page
return View::make('frontend/account/change-password', compact('user'));
}
// Show the page
return View::make('frontend/account/change-password', compact('user'));
}
/**
* User change password form processing page.
*
* @return Redirect
*/
protected function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'old_password' => 'required|min:6',
'password' => 'required|min:6',
'password_confirm' => 'required|same:password',
);
/**
* User change password form processing page.
*
* @return Redirect
*/
protected function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'old_password' => 'required|between:3,32',
'password' => 'required|between:3,32',
'password_confirm' => 'required|same:password',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Grab the user
$user = Sentry::getUser();
// Grab the user
$user = Sentry::getUser();
// Check the user current password
if ( ! $user->checkPassword(Input::get('old_password'))) {
// Set the error message
$this->messageBag->add('old_password', 'Your current password is incorrect.');
// Check the user current password
if ( ! $user->checkPassword(Input::get('old_password')))
{
// Set the error message
$this->messageBag->add('old_password', 'Your current password is incorrect.');
// Redirect to the change password page
return Redirect::route('change-password')->withErrors($this->messageBag);
}
// Redirect to the change password page
return Redirect::route('change-password')->withErrors($this->messageBag);
}
// Update the user password
$user->password = Input::get('password');
$user->save();
// Update the user password
$user->password = Input::get('password');
$user->save();
// Redirect to the change-password page
return Redirect::route('change-password')->with('success', 'Password successfully updated');
}
// Redirect to the change-password page
return Redirect::route('change-password')->with('success', 'Password successfully updated');
}
}
+12 -12
View File
@@ -3,17 +3,17 @@
use AuthorizedController;
use Redirect;
class DashboardController extends AuthorizedController {
/**
* Redirect to the profile page.
*
* @return Redirect
*/
public function getIndex()
{
// Redirect to the profile page
return Redirect::route('profile');
}
class DashboardController extends AuthorizedController
{
/**
* Redirect to the profile page.
*
* @return Redirect
*/
public function getIndex()
{
// Redirect to the profile page
return Redirect::route('profile');
}
}
+50 -51
View File
@@ -8,65 +8,64 @@ use Validator;
use Location;
use View;
class ProfileController extends AuthorizedController {
class ProfileController extends AuthorizedController
{
/**
* User profile page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
/**
* User profile page.
*
* @return View
*/
public function getIndex()
{
// Get the user information
$user = Sentry::getUser();
// Show the page
// Show the page
$location_list = array('' => 'Select One') + Location::lists('name', 'id');
$location_list = array('' => 'Select One') + Location::lists('name', 'id');
// Show the page
return View::make('frontend/account/profile', compact('user'))->with('location_list',$location_list);
}
// Show the page
return View::make('frontend/account/profile', compact('user'))->with('location_list',$location_list);
}
/**
* User profile form processing page.
*
* @return Redirect
*/
public function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|alpha_space|min:2',
'last_name' => 'required|alpha_space|min:2',
'location_id' => 'required',
'website' => 'url|alpha_space|min:10',
'gravatar' => 'email',
);
/**
* User profile form processing page.
*
* @return Redirect
*/
public function postIndex()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:3',
'last_name' => 'required|min:3',
'location_id' => 'required',
'website' => 'url',
'gravatar' => 'email',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Grab the user
$user = Sentry::getUser();
// Grab the user
$user = Sentry::getUser();
// Update the user information
$user->first_name = Input::get('first_name');
$user->last_name = Input::get('last_name');
$user->website = Input::get('website');
$user->location_id = Input::get('location_id');
$user->gravatar = Input::get('gravatar');
$user->save();
// Update the user information
$user->first_name = Input::get('first_name');
$user->last_name = Input::get('last_name');
$user->website = Input::get('website');
$user->location_id = Input::get('location_id');
$user->gravatar = Input::get('gravatar');
$user->save();
// Redirect to the settings page
return Redirect::route('profile')->with('success', 'Account successfully updated');
}
// Redirect to the settings page
return Redirect::route('profile')->with('success', 'Account successfully updated');
}
}
+36
View File
@@ -0,0 +1,36 @@
<?php namespace Controllers\Account;
use AuthorizedController;
use Input;
use Redirect;
use Sentry;
use Validator;
use Location;
use View;
class ViewAssetsController extends AuthorizedController
{
/**
* Redirect to the profile page.
*
* @return Redirect
*/
public function getIndex()
{
$user = Sentry::getUser();
if (isset($user->id)) {
return View::make('frontend/account/view-assets', compact('user'));
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
// Redirect to the user management page
return Redirect::route('users')->with('error', $error);
}
}
}
+611 -601
View File
File diff suppressed because it is too large Load Diff
+130 -137
View File
@@ -12,176 +12,169 @@ use Str;
use Validator;
use View;
class CategoriesController extends AdminController {
class CategoriesController extends AdminController
{
/**
* Show a list of all the categories.
*
* @return View
*/
/**
* Show a list of all the categories.
*
* @return View
*/
public function getIndex()
{
// Grab all the categories
$categories = Category::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
public function getIndex()
{
// Grab all the categories
$categories = Category::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/categories/index', compact('categories'));
}
// Show the page
return View::make('backend/categories/index', compact('categories'));
}
/**
* Category create.
*
* @return View
*/
public function getCreate()
{
// Show the page
return View::make('backend/categories/edit')->with('category',new Category);
}
/**
* Category create.
*
* @return View
*/
public function getCreate()
{
// Show the page
return View::make('backend/categories/edit')->with('category',new Category);
}
/**
* Category create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Category create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// create a new model instance
$category = new Category();
$validator = Validator::make(Input::all(), $category->rules);
// create a new model instance
$category = new Category();
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
else{
// attempt validation
if ($category->validate($new))
{
// Update the category data
$category->name = e(Input::get('name'));
$category->user_id = Sentry::getId();
// Update the category data
$category->name = e(Input::get('name'));
$category->user_id = Sentry::getId();
// Was the asset created?
if($category->save()) {
// Redirect to the new category page
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.create.success'));
}
}
// Was the asset created?
if($category->save())
{
// Redirect to the new category page
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.create.success'));
}
}
else
{
// failure
$errors = $category->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the category create page
return Redirect::to('admin/settings/categories/create')->with('error', Lang::get('admin/categories/message.create.error'));
// Redirect to the category create page
return Redirect::to('admin/settings/categories/create')->with('error', Lang::get('admin/categories/message.create.error'));
}
}
/**
* Category update.
*
* @param int $categoryId
* @return View
*/
public function getEdit($categoryId = null)
{
// Check if the category exists
if (is_null($category = Category::find($categoryId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
}
/**
* Category update.
*
* @param int $categoryId
* @return View
*/
public function getEdit($categoryId = null)
{
// Check if the category exists
if (is_null($category = Category::find($categoryId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
}
// Show the page
//$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
// Show the page
//$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
return View::make('backend/categories/edit', compact('category'))->with('category_options',$category_options);
}
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
return View::make('backend/categories/edit', compact('category'))->with('category_options',$category_options);
}
/**
* Category update form processing page.
*
* @param int $categoryId
* @return Redirect
*/
public function postEdit($categoryId = null)
{
// Check if the blog post exists
if (is_null($category = Category::find($categoryId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
}
/**
* Category update form processing page.
*
* @param int $categoryId
* @return Redirect
*/
public function postEdit($categoryId = null)
{
// Check if the blog post exists
if (is_null($category = Category::find($categoryId))) {
// Redirect to the blogs management page
return Redirect::to('admin/categories')->with('error', Lang::get('admin/categories/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// attempt validation
if ($category->validate($new))
{
// attempt validation
$validator = Validator::make(Input::all(), $category->validationRules($categoryId));
// Update the category data
$category->name = e(Input::get('name'));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Was the asset created?
if($category->save())
{
// Redirect to the new category page
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.update.success'));
}
}
else
{
// failure
$errors = $category->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Update the category data
$category->name = e(Input::get('name'));
// Redirect to the category management page
return Redirect::to("admin/settings/categories/$categoryID/edit")->with('error', Lang::get('admin/categories/message.update.error'));
// Was the asset created?
if($category->save()) {
// Redirect to the new category page
return Redirect::to("admin/settings/categories")->with('success', Lang::get('admin/categories/message.update.success'));
}
}
}
// Redirect to the category management page
return Redirect::to("admin/settings/categories/$categoryID/edit")->with('error', Lang::get('admin/categories/message.update.error'));
/**
* Delete the given category.
*
* @param int $categoryId
* @return Redirect
*/
public function getDelete($categoryId)
{
// Check if the blog post exists
if (is_null($category = Category::find($categoryId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.not_found'));
}
}
/**
* Delete the given category.
*
* @param int $categoryId
* @return Redirect
*/
public function getDelete($categoryId)
{
// Check if the blog post exists
if (is_null($category = Category::find($categoryId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.not_found'));
}
if ($category->has_models() > 0) {
if ($category->has_models() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.assoc_users'));
} else {
// Redirect to the asset management page
return Redirect::to('admin/settings/categories')->with('error', Lang::get('admin/categories/message.assoc_users'));
} else {
$category->delete();
$category->delete();
// Redirect to the locations management page
return Redirect::to('admin/settings/categories')->with('success', Lang::get('admin/categories/message.delete.success'));
}
// Redirect to the locations management page
return Redirect::to('admin/settings/categories')->with('success', Lang::get('admin/categories/message.delete.success'));
}
}
}
+12 -12
View File
@@ -3,17 +3,17 @@
use AdminController;
use View;
class DashboardController extends AdminController {
/**
* Show the administration dashboard page.
*
* @return View
*/
public function getIndex()
{
// Show the page
return View::make('backend/dashboard');
}
class DashboardController extends AdminController
{
/**
* Show the administration dashboard page.
*
* @return View
*/
public function getIndex()
{
// Show the page
return View::make('backend/dashboard');
}
}
+129 -141
View File
@@ -12,178 +12,166 @@ use Str;
use Validator;
use View;
class DepreciationsController extends AdminController {
class DepreciationsController extends AdminController
{
/**
* Show a list of all the depreciations.
*
* @return View
*/
/**
* Show a list of all the depreciations.
*
* @return View
*/
public function getIndex()
{
// Grab all the depreciations
$depreciations = Depreciation::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
public function getIndex()
{
// Grab all the depreciations
$depreciations = Depreciation::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/depreciations/index', compact('depreciations'));
}
// Show the page
return View::make('backend/depreciations/index', compact('depreciations'));
}
/**
* Depreciation create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$depreciation_options = array('0' => 'Top Level') + Depreciation::lists('name', 'id');
return View::make('backend/depreciations/edit')->with('depreciation_options',$depreciation_options)->with('depreciation',new Depreciation);
}
/**
* Depreciation create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$depreciation_options = array('0' => 'Top Level') + Depreciation::lists('name', 'id');
return View::make('backend/depreciations/edit')->with('depreciation_options',$depreciation_options)->with('depreciation',new Depreciation);
}
/**
* Depreciation create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Depreciation create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// create a new instance
$depreciation = new Depreciation();
// create a new instance
$depreciation = new Depreciation();
// attempt validation
if ($depreciation->validate($new))
{
// attempt validation
if ($depreciation->validate($new)) {
// Depreciation data
$depreciation->name = e(Input::get('name'));
$depreciation->months = e(Input::get('months'));
$depreciation->user_id = Sentry::getId();
// Depreciation data
$depreciation->name = e(Input::get('name'));
$depreciation->months = e(Input::get('months'));
$depreciation->user_id = Sentry::getId();
// Was the asset created?
if($depreciation->save())
{
// Redirect to the new depreciation page
return Redirect::to("admin/settings/depreciations")->with('success', Lang::get('admin/depreciations/message.create.success'));
}
}
else
{
// failure
$errors = $depreciation->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Was the asset created?
if($depreciation->save()) {
// Redirect to the new depreciation page
return Redirect::to("admin/settings/depreciations")->with('success', Lang::get('admin/depreciations/message.create.success'));
}
} else {
// failure
$errors = $depreciation->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the depreciation create page
return Redirect::to('admin/settings/depreciations/create')->with('error', Lang::get('admin/depreciations/message.create.error'));
// Redirect to the depreciation create page
return Redirect::to('admin/settings/depreciations/create')->with('error', Lang::get('admin/depreciations/message.create.error'));
}
}
/**
* Depreciation update.
*
* @param int $depreciationId
* @return View
*/
public function getEdit($depreciationId = null)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
}
/**
* Depreciation update.
*
* @param int $depreciationId
* @return View
*/
public function getEdit($depreciationId = null)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
}
// Show the page
//$depreciation_options = array('' => 'Top Level') + Depreciation::lists('name', 'id');
// Show the page
//$depreciation_options = array('' => 'Top Level') + Depreciation::lists('name', 'id');
$depreciation_options = array('' => 'Top Level') + DB::table('depreciations')->where('id', '!=', $depreciationId)->lists('name', 'id');
return View::make('backend/depreciations/edit', compact('depreciation'))->with('depreciation_options',$depreciation_options);
}
$depreciation_options = array('' => 'Top Level') + DB::table('depreciations')->where('id', '!=', $depreciationId)->lists('name', 'id');
return View::make('backend/depreciations/edit', compact('depreciation'))->with('depreciation_options',$depreciation_options);
}
/**
* Depreciation update form processing page.
*
* @param int $depreciationId
* @return Redirect
*/
public function postEdit($depreciationId = null)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
}
/**
* Depreciation update form processing page.
*
* @param int $depreciationId
* @return Redirect
*/
public function postEdit($depreciationId = null)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.does_not_exist'));
}
//attempt to validate
$validator = Validator::make(Input::all(), $depreciation->validationRules($depreciationId));
// get the POST data
$new = Input::all();
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Depreciation data
$depreciation->name = e(Input::get('name'));
$depreciation->months = e(Input::get('months'));
// attempt validation
if ($depreciation->validate($new))
{
// Was the asset created?
if($depreciation->save()) {
// Redirect to the depreciation page
return Redirect::to("admin/settings/depreciations/")->with('success', Lang::get('admin/depreciations/message.update.success'));
}
}
// Depreciation data
$depreciation->name = e(Input::get('name'));
$depreciation->months = e(Input::get('months'));
// Was the asset created?
if($depreciation->save())
{
// Redirect to the depreciation page
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('success', Lang::get('admin/depreciations/message.update.success'));
}
}
else
{
// failure
$errors = $depreciation->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the depreciation management page
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('error', Lang::get('admin/depreciations/message.update.error'));
// Redirect to the depreciation management page
return Redirect::to("admin/settings/depreciations/$depreciationId/edit")->with('error', Lang::get('admin/depreciations/message.update.error'));
}
}
/**
* Delete the given depreciation.
*
* @param int $depreciationId
* @return Redirect
*/
public function getDelete($depreciationId)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.not_found'));
}
/**
* Delete the given depreciation.
*
* @param int $depreciationId
* @return Redirect
*/
public function getDelete($depreciationId)
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.not_found'));
}
if ($depreciation->has_models() > 0) {
if ($depreciation->has_models() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.assoc_users'));
} else {
// Redirect to the asset management page
return Redirect::to('admin/settings/depreciations')->with('error', Lang::get('admin/depreciations/message.assoc_users'));
} else {
$depreciation->delete();
$depreciation->delete();
// Redirect to the depreciations management page
return Redirect::to('admin/settings/depreciations')->with('success', Lang::get('admin/depreciations/message.delete.success'));
}
// Redirect to the depreciations management page
return Redirect::to('admin/settings/depreciations')->with('success', Lang::get('admin/depreciations/message.delete.success'));
}
}
}
+164 -187
View File
@@ -13,219 +13,196 @@ use Sentry;
use Validator;
use View;
class GroupsController extends AdminController {
class GroupsController extends AdminController
{
/**
* Show a list of all the groups.
*
* @return View
*/
public function getIndex()
{
// Grab all the groups
$groups = Sentry::getGroupProvider()->createModel()->paginate();
/**
* Show a list of all the groups.
*
* @return View
*/
public function getIndex()
{
// Grab all the groups
$groups = Sentry::getGroupProvider()->createModel()->paginate();
// Show the page
return View::make('backend/groups/index', compact('groups'));
}
// Show the page
return View::make('backend/groups/index', compact('groups'));
}
/**
* Group create.
*
* @return View
*/
public function getCreate()
{
// Get all the available permissions
$permissions = Config::get('permissions');
$this->encodeAllPermissions($permissions, true);
/**
* Group create.
*
* @return View
*/
public function getCreate()
{
// Get all the available permissions
$permissions = Config::get('permissions');
$this->encodeAllPermissions($permissions, true);
// Selected permissions
$selectedPermissions = Input::old('permissions', array());
// Selected permissions
$selectedPermissions = Input::old('permissions', array());
// Show the page
return View::make('backend/groups/create', compact('permissions', 'selectedPermissions'));
}
// Show the page
return View::make('backend/groups/create', compact('permissions', 'selectedPermissions'));
}
/**
* Group create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// Declare the rules for the form validation
$rules = array(
'name' => 'required|alpha_space|min:2',
);
/**
* Group create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// Declare the rules for the form validation
$rules = array(
'name' => 'required|alpha_space|min:2',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// We need to reverse the UI specific logic for our
// permissions here before we create the user.
$permissions = Input::get('permissions', array());
$this->decodePermissions($permissions);
app('request')->request->set('permissions', $permissions);
try
{
// We need to reverse the UI specific logic for our
// permissions here before we create the user.
$permissions = Input::get('permissions', array());
$this->decodePermissions($permissions);
app('request')->request->set('permissions', $permissions);
// Get the inputs, with some exceptions
$inputs = Input::except('_token');
// Get the inputs, with some exceptions
$inputs = Input::except('_token');
// Was the group created?
if ($group = Sentry::getGroupProvider()->create($inputs)) {
// Redirect to the new group page
return Redirect::route('update/group', $group->id)->with('success', Lang::get('admin/groups/message.success.create'));
}
// Was the group created?
if ($group = Sentry::getGroupProvider()->create($inputs))
{
// Redirect to the new group page
return Redirect::route('update/group', $group->id)->with('success', Lang::get('admin/groups/message.success.create'));
}
// Redirect to the new group page
return Redirect::route('create/group')->with('error', Lang::get('admin/groups/message.error.create'));
} catch (NameRequiredException $e) {
$error = 'group_name_required';
} catch (GroupExistsException $e) {
$error = 'group_exists';
}
// Redirect to the new group page
return Redirect::route('create/group')->with('error', Lang::get('admin/groups/message.error.create'));
}
catch (NameRequiredException $e)
{
$error = 'group_name_required';
}
catch (GroupExistsException $e)
{
$error = 'group_exists';
}
// Redirect to the group create page
return Redirect::route('create/group')->withInput()->with('error', Lang::get('admin/groups/message.'.$error));
}
// Redirect to the group create page
return Redirect::route('create/group')->withInput()->with('error', Lang::get('admin/groups/message.'.$error));
}
/**
* Group update.
*
* @param int $id
* @return View
*/
public function getEdit($id = null)
{
try {
// Get the group information
$group = Sentry::getGroupProvider()->findById($id);
/**
* Group update.
*
* @param int $id
* @return View
*/
public function getEdit($id = null)
{
try
{
// Get the group information
$group = Sentry::getGroupProvider()->findById($id);
// Get all the available permissions
$permissions = Config::get('permissions');
$this->encodeAllPermissions($permissions, true);
// Get all the available permissions
$permissions = Config::get('permissions');
$this->encodeAllPermissions($permissions, true);
// Get this group permissions
$groupPermissions = $group->getPermissions();
$this->encodePermissions($groupPermissions);
$groupPermissions = array_merge($groupPermissions, Input::old('permissions', array()));
} catch (GroupNotFoundException $e) {
// Redirect to the groups management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
// Get this group permissions
$groupPermissions = $group->getPermissions();
$this->encodePermissions($groupPermissions);
$groupPermissions = array_merge($groupPermissions, Input::old('permissions', array()));
}
catch (GroupNotFoundException $e)
{
// Redirect to the groups management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
// Show the page
return View::make('backend/groups/edit', compact('group', 'permissions', 'groupPermissions'));
}
// Show the page
return View::make('backend/groups/edit', compact('group', 'permissions', 'groupPermissions'));
}
/**
* Group update form processing page.
*
* @param int $id
* @return Redirect
*/
public function postEdit($id = null)
{
// We need to reverse the UI specific logic for our
// permissions here before we update the group.
$permissions = Input::get('permissions', array());
$this->decodePermissions($permissions);
app('request')->request->set('permissions', $permissions);
/**
* Group update form processing page.
*
* @param int $id
* @return Redirect
*/
public function postEdit($id = null)
{
// We need to reverse the UI specific logic for our
// permissions here before we update the group.
$permissions = Input::get('permissions', array());
$this->decodePermissions($permissions);
app('request')->request->set('permissions', $permissions);
try {
// Get the group information
$group = Sentry::getGroupProvider()->findById($id);
} catch (GroupNotFoundException $e) {
// Redirect to the groups management page
return Rediret::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
try
{
// Get the group information
$group = Sentry::getGroupProvider()->findById($id);
}
catch (GroupNotFoundException $e)
{
// Redirect to the groups management page
return Rediret::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
// Declare the rules for the form validation
$rules = array(
'name' => 'required|alpha_space|min:2',
);
// Declare the rules for the form validation
$rules = array(
'name' => 'required|alpha_space|min:2',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
try
{
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
// Was the group updated?
if ($group->save()) {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
} else {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
}
} catch (NameRequiredException $e) {
$error = Lang::get('admin/group/message.group_name_required');
}
// Was the group updated?
if ($group->save())
{
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
}
else
{
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
}
}
catch (NameRequiredException $e)
{
$error = Lang::get('admin/group/message.group_name_required');
}
// Redirect to the group page
return Redirect::route('update/group', $id)->withInput()->with('error', $error);
}
// Redirect to the group page
return Redirect::route('update/group', $id)->withInput()->with('error', $error);
}
/**
* Delete the given group.
*
* @param int $id
* @return Redirect
*/
public function getDelete($id = null)
{
try {
// Get group information
$group = Sentry::getGroupProvider()->findById($id);
/**
* Delete the given group.
*
* @param int $id
* @return Redirect
*/
public function getDelete($id = null)
{
try
{
// Get group information
$group = Sentry::getGroupProvider()->findById($id);
// Delete the group
$group->delete();
// Delete the group
$group->delete();
// Redirect to the group management page
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.delete'));
}
catch (GroupNotFoundException $e)
{
// Redirect to the group management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
}
// Redirect to the group management page
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.delete'));
} catch (GroupNotFoundException $e) {
// Redirect to the group management page
return Redirect::route('groups')->with('error', Lang::get('admin/groups/message.group_not_found', compact('id')));
}
}
}
+497 -414
View File
@@ -1,5 +1,6 @@
<?php namespace Controllers\Admin;
use Assets;
use AdminController;
use Input;
use Lang;
@@ -17,466 +18,548 @@ use Str;
use Validator;
use View;
class LicensesController extends AdminController {
/**
* Show a list of all the licenses.
*
* @return View
*/
public function getIndex()
{
// Grab all the licenses
$licenses = License::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/licenses/index', compact('licenses'));
}
/**
* License create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
}
/**
* License create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// create a new model instance
$license = new License();
// attempt validation
if ($license->validate($new))
{
// Save the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->seats = e(Input::get('seats'));
$license->purchase_date = e(Input::get('purchase_date'));
$license->purchase_cost = e(Input::get('purchase_cost'));
$license->depreciate = e(Input::get('depreciate'));
$license->user_id = Sentry::getId();
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
$license->purchase_date = NULL;
}
if (($license->purchase_cost == "") || ($license->purchase_cost == "0.00")) {
$license->purchase_cost = NULL;
}
if ($license->depreciate == "") {
$license->depreciate = 0;
}
// Was the license created?
if($license->save())
{
$insertedId = $license->id;
// Save the license seat data
for ($x=0; $x<$license->seats; $x++) {
$license_seat = new LicenseSeat();
$license_seat->license_id = $insertedId;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
// Redirect to the new license page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.create.success'));
}
}
else
{
// failure
$errors = $license->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the license create page
return Redirect::to('admin/licenses/edit')->with('error', Lang::get('admin/licenses/message.create.error'))->with('license',new License);
}
/**
* License update.
*
* @param int $licenseId
* @return View
*/
public function getEdit($licenseId = null)
{
// Check if the license exists
if (is_null($license = License::find($licenseId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
if ($license->purchase_date == "0000-00-00") {
$license->purchase_date = NULL;
}
if ($license->purchase_cost == "0.00") {
$license->purchase_cost = NULL;
}
// Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
}
/**
* License update form processing page.
*
* @param int $licenseId
* @return Redirect
*/
public function postEdit($licenseId = null)
{
// Check if the license exists
if (is_null($license = License::find($licenseId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
class LicensesController extends AdminController
{
/**
* Show a list of all the licenses.
*
* @return View
*/
// attempt validation
if ($license->validate($new))
{
// Update the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->purchase_date = e(Input::get('purchase_date'));
$license->purchase_cost = e(Input::get('purchase_cost'));
public function getIndex()
{
// Grab all the licenses
$licenses = License::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
//Are we changing the total number of seats?
if( $license->seats != e(Input::get('seats')))
{
//Determine how many seats we are dealing with
$difference = e(Input::get('seats')) - $license->licenseseats()->count();
// Show the page
return View::make('backend/licenses/index', compact('licenses'));
}
if( $difference < 0 )
{
//Filter out any license which have a user attached;
$seats = $license->licenseseats->filter(function($seat)
{
return is_null($seat->user);
});
//If the remaining collection is as large or larger than the number of seats we want to delete
if($seats->count() >= abs($difference))
{
for ($i=1; $i <= abs($difference); $i++) {
//Delete the appropriate number of seats
$seats->first()->delete();
}
/**
* License create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
//Log the deletion of seats to the log
$logaction = new Actionlog();
$logaction->asset_id = $license->id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = abs($difference)." seats";
$log = $logaction->logaction('delete seats');
} else {
// Redirect to the license edit page
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.assoc_users'));
}
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
}
/**
* License create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// create a new model instance
$license = new License();
// attempt validation
if ($license->validate($new)) {
if ( e(Input::get('purchase_cost')) == '') {
$license->purchase_cost = NULL;
} else {
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
//$license->purchase_cost = e(Input::get('purchase_cost'));
}
// Save the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->seats = e(Input::get('seats'));
$license->purchase_date = e(Input::get('purchase_date'));
//$license->purchase_cost = e(Input::get('purchase_cost'));
$license->depreciation_id = e(Input::get('depreciation_id'));
//$license->asset_id = e(Input::get('asset_id'));
$license->user_id = Sentry::getId();
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
$license->purchase_date = NULL;
}
if (($license->purchase_cost == "") || ($license->purchase_cost == "0.00")) {
$license->purchase_cost = NULL;
}
// Was the license created?
if($license->save()) {
$insertedId = $license->id;
// Save the license seat data
for ($x=0; $x<$license->seats; $x++) {
$license_seat = new LicenseSeat();
$license_seat->license_id = $insertedId;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
// Redirect to the new license page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.create.success'));
}
} else {
// failure
$errors = $license->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the license create page
return Redirect::to('admin/licenses/edit')->with('error', Lang::get('admin/licenses/message.create.error'))->with('license',new License);
}
/**
* License update.
*
* @param int $licenseId
* @return View
*/
public function getEdit($licenseId = null)
{
// Check if the license exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
if ($license->purchase_date == "0000-00-00") {
$license->purchase_date = NULL;
}
if ($license->purchase_cost == "0.00") {
$license->purchase_cost = NULL;
}
// Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
}
/**
* License update form processing page.
*
* @param int $licenseId
* @return Redirect
*/
public function postEdit($licenseId = null)
{
// Check if the license exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
// attempt validation
if ($license->validate($new)) {
// Update the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->depreciation_id = e(Input::get('depreciation_id'));
// Update the asset data
if ( e(Input::get('purchase_date')) == '') {
$license->purchase_date = NULL;
} else {
$license->purchase_date = e(Input::get('purchase_date'));
}
if ( e(Input::get('purchase_cost')) == '') {
$license->purchase_cost = NULL;
} else {
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
//$license->purchase_cost = e(Input::get('purchase_cost'));
}
//Are we changing the total number of seats?
if( $license->seats != e(Input::get('seats'))) {
//Determine how many seats we are dealing with
$difference = e(Input::get('seats')) - $license->licenseseats()->count();
if( $difference < 0 ) {
//Filter out any license which have a user attached;
$seats = $license->licenseseats->filter(function ($seat) {
return is_null($seat->user);
});
//If the remaining collection is as large or larger than the number of seats we want to delete
if($seats->count() >= abs($difference)) {
for ($i=1; $i <= abs($difference); $i++) {
//Delete the appropriate number of seats
$seats->pop()->delete();
}
//Log the deletion of seats to the log
$logaction = new Actionlog();
$logaction->asset_id = $license->id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = abs($difference)." seats";
$logaction->checkedout_to = NULL;
$log = $logaction->logaction('delete seats');
} else {
// Redirect to the license edit page
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.assoc_users'));
}
} else {
for ($i=1; $i <= $difference; $i++) {
//Create a seat for this license
$license_seat = new LicenseSeat();
$license_seat->license_id = $license->id;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
//Log the addition of license to the log.
$logaction = new Actionlog();
$logaction->asset_id = $license->id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = abs($difference)." seats";
$log = $logaction->logaction('add seats');
}
$license->seats = e(Input::get('seats'));
}
// Was the asset created?
if($license->save()) {
// Redirect to the new license page
return Redirect::to("admin/licenses/$licenseId/view")->with('success', Lang::get('admin/licenses/message.update.success'));
}
} else {
// failure
$errors = $license->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the license edit page
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.update.error'));
}
/**
* Delete the given license.
*
* @param int $licenseId
* @return Redirect
*/
public function getDelete($licenseId)
{
// Check if the license exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the license management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
if (($license->assignedcount()) && ($license->assignedcount() > 0)) {
// Redirect to the license management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.assoc_users'));
} else {
// Delete the license and the associated license seats
$licenseseats = $license->licenseseats();
$licenseseats->delete();
$license->delete();
// Redirect to the licenses management page
return Redirect::to('admin/licenses')->with('success', Lang::get('admin/licenses/message.delete.success'));
}
}
/**
* Check out the asset to a person
**/
public function getCheckout($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
// Left join to get a list of assets and some other helpful info
$asset = DB::table('assets')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
->whereNull('assets.deleted_at')
->get();
$asset_array = json_decode(json_encode($asset), true);
$asset_element[''] = 'Please select an asset';
// Build a list out of the data results
for ($x=0; $x<count($asset_array); $x++) {
if ($asset_array[$x]['full_name']!='') {
$full_name = ' ('.$asset_array[$x]['full_name'].')';
} else {
for ($i=1; $i <= $difference; $i++) {
//Create a seat for this license
$license_seat = new LicenseSeat();
$license_seat->license_id = $license->id;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
//Log the addition of license to the log.
$logaction = new Actionlog();
$logaction->asset_id = $license->id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = abs($difference)." seats";
$log = $logaction->logaction('add seats');
$full_name = ' (Unassigned)';
}
$license->seats = e(Input::get('seats'));
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
}
// Was the asset created?
if($license->save())
{
// Redirect to the new license page
return Redirect::to("admin/licenses/$licenseId/view")->with('success', Lang::get('admin/licenses/message.update.success'));
return View::make('backend/licenses/checkout', compact('licenseseat'))->with('users_list',$users_list)->with('asset_list',$asset_element);
}
/**
* Check out the asset to a person
**/
public function postCheckout($seatId)
{
$assigned_to = e(Input::get('assigned_to'));
$asset_id = e(Input::get('asset_id'));
// Declare the rules for the form validation
$rules = array(
'note' => 'alpha_space',
// 'asset_id' => 'required_without:assigned_to:min:1',
'asset_id' => 'required',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
if ($assigned_to!='') {
// Check if the user exists
if (is_null($is_assigned_to = User::find($assigned_to))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
}
}
else
{
// failure
$errors = $license->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
}
// Redirect to the license edit page
return Redirect::to("admin/licenses/$licenseId/edit")->with('error', Lang::get('admin/licenses/message.update.error'));
if ($asset_id!='') {
}
if (is_null($is_asset_id = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.asset_does_not_exist'));
}
/**
* Delete the given license.
*
* @param int $licenseId
* @return Redirect
*/
public function getDelete($licenseId)
{
// Check if the license exists
if (is_null($license = License::find($licenseId)))
{
// Redirect to the license management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!='')) {
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.owner_doesnt_match_asset'));
}
if (($license->assignedcount()) && ($license->assignedcount() > 0)) {
// Redirect to the license management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.assoc_users'));
} else {
// Delete the license and the associated license seats
$licenseseats = $license->licenseseats();
$licenseseats->delete();
$license->delete();
// Redirect to the licenses management page
return Redirect::to('admin/licenses')->with('success', Lang::get('admin/licenses/message.delete.success'));
}
}
/**
* Check out the asset to a person
**/
public function getCheckout($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId)))
{
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
//print_r($users);
return View::make('backend/licenses/checkout', compact('licenseseat'))->with('users_list',$users_list);
}
}
/**
* Check out the asset to a person
**/
public function postCheckout($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId)))
{
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
$assigned_to = e(Input::get('assigned_to'));
$licenseseat->asset_id = e(Input::get('asset_id'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|integer|min:1',
'note' => 'alpha_space',
);
// Update the asset data
if ( e(Input::get('assigned_to')) == '') {
$licenseseat->assigned_to = NULL;
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
} else {
$licenseseat->assigned_to = e(Input::get('assigned_to'));
}
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Was the asset updated?
if($licenseseat->save()) {
$logaction = new Actionlog();
//$logaction->location_id = $assigned_to->location_id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
// Check if the user exists
if (is_null($assigned_to = User::find($assigned_to)))
{
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
}
// Update the asset data
if ( e(Input::get('assigned_to')) == '') {
$logaction->checkedout_to = NULL;
} else {
$logaction->checkedout_to = e(Input::get('assigned_to'));
}
$log = $logaction->logaction('checkout');
// Update the asset data
$licenseseat->assigned_to = e(Input::get('assigned_to'));
// Redirect to the new asset page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkout.success'));
}
// Redirect to the asset management page with error
return Redirect::to('admin/licenses/$assetId/checkout')->with('error', Lang::get('admin/licenses/message.create.error'))->with('license',new License);
}
// Was the asset updated?
if($licenseseat->save())
{
$logaction = new Actionlog();
$logaction->asset_id = $licenseseat->license_id;
$logaction->checkedout_to = $licenseseat->assigned_to;
$logaction->location_id = $assigned_to->location_id;
$logaction->asset_type = 'software';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');
/**
* Check the license back into inventory
**/
public function getCheckin($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
return View::make('backend/licenses/checkin', compact('licenseseat'));
// Redirect to the new asset page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkout.success'));
}
// Redirect to the asset management page with error
return Redirect::to('admin/licenses/$assetId/checkout')->with('error', Lang::get('admin/licenses/message.create.error'))->with('license',new License);
}
/**
* Check the license back into inventory
**/
public function getCheckin($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId)))
{
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
return View::make('backend/licenses/checkin', compact('licenseseat'));
}
}
/**
* Check in the item so that it can be checked out again to someone else
**/
public function postCheckin($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId)))
{
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
/**
* Check in the item so that it can be checked out again to someone else
**/
public function postCheckin($seatId)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
// Declare the rules for the form validation
$rules = array(
'note' => 'alpha_space',
'notes' => 'alpha_space',
);
// Declare the rules for the form validation
$rules = array(
'note' => 'alpha_space',
'notes' => 'alpha_space',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
$logaction = new Actionlog();
$logaction->checkedout_to = $licenseseat->assigned_to;
$logaction = new Actionlog();
$logaction->checkedout_to = $licenseseat->assigned_to;
// Update the asset data
$licenseseat->assigned_to = '0';
// Update the asset data
$licenseseat->assigned_to = '0';
$licenseseat->asset_id = NULL;
// Was the asset updated?
if($licenseseat->save())
{
$logaction->asset_id = $licenseseat->license_id;
$logaction->location_id = NULL;
$logaction->asset_type = 'software';
$logaction->note = e(Input::get('note'));
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkin from');
// Was the asset updated?
if($licenseseat->save()) {
$logaction->asset_id = NULL;
$logaction->location_id = NULL;
$logaction->asset_type = 'software';
$logaction->note = e(Input::get('note'));
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkin from');
// Redirect to the license page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkin.success'));
}
// Redirect to the license page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkin.success'));
}
// Redirect to the license page with error
return Redirect::to("admin/licenses")->with('error', Lang::get('admin/licenses/message.checkin.error'));
}
// Redirect to the license page with error
return Redirect::to("admin/licenses")->with('error', Lang::get('admin/licenses/message.checkin.error'));
}
/**
* Get the asset information to present to the asset view page
*
* @param int $assetId
* @return View
**/
public function getView($licenseId = null)
{
$license = License::find($licenseId);
/**
* Get the asset information to present to the asset view page
*
* @param int $assetId
* @return View
**/
public function getView($licenseId = null)
{
$license = License::find($licenseId);
if (isset($license->id)) {
return View::make('backend/licenses/view', compact('license'));
} else {
// Prepare the error message
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id'));
if (isset($license->id)) {
return View::make('backend/licenses/view', compact('license'));
} else {
// Prepare the error message
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('licenses')->with('error', $error);
}
}
// Redirect to the user management page
return Redirect::route('licenses')->with('error', $error);
}
}
public function getClone($licenseId = null)
{
// Check if the license exists
if (is_null($license_to_clone = License::find($licenseId))) {
// Redirect to the blogs management page
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.does_not_exist'));
}
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
//clone the orig
$license = clone $license_to_clone;
$license->id = null;
$license->serial = null;
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',$license);
}
}
+151 -164
View File
@@ -12,192 +12,179 @@ use Str;
use Validator;
use View;
class LocationsController extends AdminController {
class LocationsController extends AdminController
{
/**
* Show a list of all the locations.
*
* @return View
*/
/**
* Show a list of all the locations.
*
* @return View
*/
public function getIndex()
{
// Grab all the locations
$locations = Location::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
public function getIndex()
{
// Grab all the locations
$locations = Location::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/locations/index', compact('locations'));
}
// Show the page
return View::make('backend/locations/index', compact('locations'));
}
/**
* Location create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$location_options = array('0' => 'Top Level') + Location::lists('name', 'id');
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
}
/**
* Location create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$location_options = array('0' => 'Top Level') + Location::lists('name', 'id');
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
}
/**
* Location create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Location create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// create a new location instance
$location = new Location();
// create a new location instance
$location = new Location();
// attempt validation
if ($location->validate($new))
{
// attempt validation
if ($location->validate($new)) {
// Save the location data
$location->name = e(Input::get('name'));
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Save the location data
$location->name = e(Input::get('name'));
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Was the asset created?
if($location->save())
{
// Redirect to the new location page
return Redirect::to("admin/settings/locations")->with('success', Lang::get('admin/locations/message.create.success'));
}
}
else
{
// failure
$errors = $location->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Was the asset created?
if($location->save()) {
// Redirect to the new location page
return Redirect::to("admin/settings/locations")->with('success', Lang::get('admin/locations/message.create.success'));
}
} else {
// failure
$errors = $location->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the location create page
return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error'));
// Redirect to the location create page
return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error'));
}
}
/**
* Location update.
*
* @param int $locationId
* @return View
*/
public function getEdit($locationId = null)
{
// Check if the location exists
if (is_null($location = Location::find($locationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
/**
* Location update.
*
* @param int $locationId
* @return View
*/
public function getEdit($locationId = null)
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
// Show the page
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
// Show the page
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
}
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
}
/**
* Location update form processing page.
*
* @param int $locationId
* @return Redirect
*/
public function postEdit($locationId = null)
{
// Check if the location exists
if (is_null($location = Location::find($locationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
/**
* Location update form processing page.
*
* @param int $locationId
* @return Redirect
*/
public function postEdit($locationId = null)
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
//attempt to validate
$validator = Validator::make(Input::all(), $location->validationRules($locationId));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the location data
$location->name = e(Input::get('name'));
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
// Was the asset created?
if($location->save()) {
// Redirect to the saved location page
return Redirect::to("admin/settings/locations/")->with('success', Lang::get('admin/locations/message.update.success'));
}
}
// Redirect to the location management page
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
}
/**
* Delete the given location.
*
* @param int $locationId
* @return Redirect
*/
public function getDelete($locationId)
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.not_found'));
}
if ($location->has_users() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
} else {
$location->delete();
// Redirect to the locations management page
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
}
// get the POST data
$new = Input::all();
// attempt validation
if ($location->validate($new))
{
// Update the location data
$location->name = e(Input::get('name'));
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
// Was the asset created?
if($location->save())
{
// Redirect to the saved location page
return Redirect::to("admin/settings/locations/$locationId/edit")->with('success', Lang::get('admin/locations/message.update.success'));
}
}
else
{
// failure
$errors = $location->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the location management page
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
}
/**
* Delete the given location.
*
* @param int $locationId
* @return Redirect
*/
public function getDelete($locationId)
{
// Check if the location exists
if (is_null($location = Location::find($locationId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.not_found'));
}
if ($location->has_users() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
} else {
$location->delete();
// Redirect to the locations management page
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
}
}
}
+123 -136
View File
@@ -11,174 +11,161 @@ use Str;
use Validator;
use View;
class ManufacturersController extends AdminController {
class ManufacturersController extends AdminController
{
/**
* Show a list of all manufacturers
*
* @return View
*/
public function getIndex()
{
// Grab all the manufacturers
$manufacturers = Manufacturer::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
/**
* Show a list of all manufacturers
*
* @return View
*/
public function getIndex()
{
// Grab all the manufacturers
$manufacturers = Manufacturer::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/manufacturers/index', compact('manufacturers'));
}
// Show the page
return View::make('backend/manufacturers/index', compact('manufacturers'));
}
/**
* Manufacturer create.
*
* @return View
*/
public function getCreate()
{
return View::make('backend/manufacturers/edit')->with('manufacturer', new Manufacturer);
}
/**
* Manufacturer create.
*
* @return View
*/
public function getCreate()
{
return View::make('backend/manufacturers/edit')->with('manufacturer', new Manufacturer);
}
/**
* Manufacturer create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Manufacturer create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// Create a new manufacturer
$manufacturer = new Manufacturer;
// Create a new manufacturer
$manufacturer = new Manufacturer;
// attempt validation
if ($manufacturer->validate($new))
{
// attempt validation
if ($manufacturer->validate($new)) {
// Save the location data
$manufacturer->name = e(Input::get('name'));
$manufacturer->user_id = Sentry::getId();
// Save the location data
$manufacturer->name = e(Input::get('name'));
$manufacturer->user_id = Sentry::getId();
// Was it created?
if($manufacturer->save())
{
// Redirect to the new manufacturer page
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.create.success'));
}
}
else
{
// failure
$errors = $manufacturer->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Was it created?
if($manufacturer->save()) {
// Redirect to the new manufacturer page
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.create.success'));
}
} else {
// failure
$errors = $manufacturer->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the manufacturer create page
return Redirect::to('admin/settings/manufacturers/create')->with('error', Lang::get('admin/manufacturers/message.create.error'));
// Redirect to the manufacturer create page
return Redirect::to('admin/settings/manufacturers/create')->with('error', Lang::get('admin/manufacturers/message.create.error'));
}
}
/**
* Manufacturer update.
*
* @param int $manufacturerId
* @return View
*/
public function getEdit($manufacturerId = null)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
{
// Redirect to the manufacturer page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
}
/**
* Manufacturer update.
*
* @param int $manufacturerId
* @return View
*/
public function getEdit($manufacturerId = null)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
// Redirect to the manufacturer page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
}
// Show the page
return View::make('backend/manufacturers/edit', compact('manufacturer'));
}
// Show the page
return View::make('backend/manufacturers/edit', compact('manufacturer'));
}
/**
* Manufacturer update form processing page.
*
* @param int $manufacturerId
* @return Redirect
*/
public function postEdit($manufacturerId = null)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
{
// Redirect to the manufacturer page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
}
/**
* Manufacturer update form processing page.
*
* @param int $manufacturerId
* @return Redirect
*/
public function postEdit($manufacturerId = null)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
// Redirect to the manufacturer page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.does_not_exist'));
}
$validator = Validator::make(Input::all(), $manufacturer->validationRules($manufacturerId));
// get the POST data
$new = Input::all();
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Save the data
$manufacturer->name = e(Input::get('name'));
// attempt validation
if ($manufacturer->validate($new))
{
// Was it created?
if($manufacturer->save()) {
// Redirect to the new manufacturer page
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.update.success'));
}
}
// Save the data
$manufacturer->name = e(Input::get('name'));
// Redirect to the manufacturer management page
return Redirect::to("admin/settings/manufacturers/$manufacturerId/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
// Was it created?
if($manufacturer->save())
{
// Redirect to the new manufacturer page
return Redirect::to("admin/settings/manufacturers")->with('success', Lang::get('admin/manufacturers/message.update.success'));
}
}
else
{
// failure
$errors = $manufacturer->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
}
// Redirect to the manufacturer management page
return Redirect::to("admin/settings/manufacturers/$manufacturerId/edit")->with('error', Lang::get('admin/manufacturers/message.update.error'));
/**
* Delete the given manufacturer.
*
* @param int $manufacturerId
* @return Redirect
*/
public function getDelete($manufacturerId)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
// Redirect to the manufacturers page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.not_found'));
}
}
if ($manufacturer->has_models() > 0) {
/**
* Delete the given manufacturer.
*
* @param int $manufacturerId
* @return Redirect
*/
public function getDelete($manufacturerId)
{
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId)))
{
// Redirect to the manufacturers page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.not_found'));
}
// Redirect to the asset management page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.assoc_users'));
} else {
if ($manufacturer->has_models() > 0) {
// Delete the manufacturer
$manufacturer->delete();
// Redirect to the asset management page
return Redirect::to('admin/settings/manufacturers')->with('error', Lang::get('admin/manufacturers/message.assoc_users'));
} else {
// Delete the manufacturer
$manufacturer->delete();
// Redirect to the manufacturers management page
return Redirect::to('admin/settings/manufacturers')->with('success', Lang::get('admin/manufacturers/message.delete.success'));
}
// Redirect to the manufacturers management page
return Redirect::to('admin/settings/manufacturers')->with('success', Lang::get('admin/manufacturers/message.delete.success'));
}
}
}
+220 -184
View File
@@ -14,216 +14,252 @@ use Str;
use Validator;
use View;
class ModelsController extends AdminController {
class ModelsController extends AdminController
{
/**
* Show a list of all the models.
*
* @return View
*/
public function getIndex()
{
// Grab all the models
$models = Model::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
/**
* Show a list of all the models.
*
* @return View
*/
public function getIndex()
{
// Grab all the models
$models = Model::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/models/index', compact('models'));
}
// Show the page
return View::make('backend/models/index', compact('models'));
}
/**
* Model create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$view = View::make('backend/models/edit');
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
$view->with('manufacturer_list',$manufacturer_list);
$view->with('model',new Model);
return $view;
}
* Model create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$view = View::make('backend/models/edit');
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
$view->with('manufacturer_list',$manufacturer_list);
$view->with('model',new Model);
return $view;
}
/**
* Model create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Model create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// Create a new manufacturer
$model = new Model;
// Create a new manufacturer
$model = new Model;
// attempt validation
if ($model->validate($new))
{
// attempt validation
if ($model->validate($new)) {
if ( e(Input::get('depreciation_id')) == '') {
$model->depreciation_id = 0;
} else {
$model->depreciation_id = e(Input::get('depreciation_id'));
}
if ( e(Input::get('eol')) == '') {
$model->eol = 0;
} else {
$model->eol = e(Input::get('eol'));
}
// Save the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
$model->depreciation_id = e(Input::get('depreciation_id'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->user_id = Sentry::getId();
$model->eol = e(Input::get('eol'));
// Save the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
//$model->depreciation_id = e(Input::get('depreciation_id'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->user_id = Sentry::getId();
//$model->eol = e(Input::get('eol'));
// Was it created?
if($model->save())
{
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
}
}
else
{
// failure
$errors = $model->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Was it created?
if($model->save()) {
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
}
} else {
// failure
$errors = $model->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the model create page
return Redirect::to('hardware/models/create')->with('error', Lang::get('admin/models/message.create.error'));
// Redirect to the model create page
return Redirect::to('hardware/models/create')->with('error', Lang::get('admin/models/message.create.error'));
}
}
/**
* Model update.
*
* @param int $modelId
* @return View
*/
public function getEdit($modelId = null)
{
// Check if the model exists
if (is_null($model = Model::find($modelId)))
{
// Redirect to the model management page
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
}
/**
* Model update.
*
* @param int $modelId
* @return View
*/
public function getEdit($modelId = null)
{
// Check if the model exists
if (is_null($model = Model::find($modelId))) {
// Redirect to the model management page
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
}
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
$view = View::make('backend/models/edit', compact('model'));
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
$view->with('manufacturer_list',$manufacturer_list);
return $view;
}
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
$view = View::make('backend/models/edit', compact('model'));
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
$view->with('manufacturer_list',$manufacturer_list);
return $view;
}
/**
* Model update form processing page.
*
* @param int $modelId
* @return Redirect
*/
public function postEdit($modelId = null)
{
// Check if the model exists
if (is_null($model = Model::find($modelId)))
{
// Redirect to the models management page
return Redirect::to('admin/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
}
/**
* Model update form processing page.
*
* @param int $modelId
* @return Redirect
*/
public function postEdit($modelId = null)
{
// Check if the model exists
if (is_null($model = Model::find($modelId))) {
// Redirect to the models management page
return Redirect::to('admin/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
//attempt to validate
$validator = Validator::make(Input::all(), $model->validationRules($modelId));
// attempt validation
if ($model->validate($new))
{
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
if ( e(Input::get('depreciation_id')) == '') {
$model->depreciation_id = 0;
} else {
$model->depreciation_id = e(Input::get('depreciation_id'));
}
if ( e(Input::get('eol')) == '') {
$model->eol = 0;
} else {
$model->eol = e(Input::get('eol'));
}
// Update the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
$model->depreciation_id = e(Input::get('depreciation_id'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->eol = e(Input::get('eol'));
// Update the model data
$model->name = e(Input::get('name'));
$model->modelno = e(Input::get('modelno'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
// Was it created?
if($model->save()) {
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.update.success'));
}
}
// Redirect to the model create page
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
}
/**
* Delete the given model.
*
* @param int $modelId
* @return Redirect
*/
public function getDelete($modelId)
{
// Check if the model exists
if (is_null($model = Model::find($modelId))) {
// Redirect to the blogs management page
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.not_found'));
}
if ($model->assets->count() > 0) {
// Throw an error that this model is associated with assets
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.assoc_users'));
} else {
// Delete the model
$model->delete();
// Redirect to the models management page
return Redirect::to('hardware/models')->with('success', Lang::get('admin/models/message.delete.success'));
}
}
// Was it created?
if($model->save())
{
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.update.success'));
}
}
else
{
// failure
$errors = $model->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
/**
* Get the asset information to present to the model view page
*
* @param int $assetId
* @return View
**/
public function getView($modelId = null)
{
$model = Model::find($modelId);
// Redirect to the model create page
return Redirect::to("hardware/models/$modelId/edit")->with('error', Lang::get('admin/models/message.update.error'));
if (isset($model->id)) {
return View::make('backend/models/view', compact('model'));
} else {
// Prepare the error message
$error = Lang::get('admin/models/message.does_not_exist', compact('id'));
}
/**
* Delete the given model.
*
* @param int $modelId
* @return Redirect
*/
public function getDelete($modelId)
{
// Check if the model exists
if (is_null($model = Model::find($modelId)))
{
// Redirect to the blogs management page
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.not_found'));
}
if ($model->assets->count() > 0) {
// Throw an error that this model is associated with assets
return Redirect::to('hardware/models')->with('error', Lang::get('admin/models/message.assoc_users'));
} else {
// Delete the model
$model->delete();
// Redirect to the models management page
return Redirect::to('hardware/models')->with('success', Lang::get('admin/models/message.delete.success'));
}
}
// Redirect to the user management page
return Redirect::route('models')->with('error', $error);
}
/**
* Get the asset information to present to the model view page
*
* @param int $assetId
* @return View
**/
public function getView($modelId = null)
{
$model = Model::find($modelId);
if (isset($model->id)) {
return View::make('backend/models/view', compact('model'));
} else {
// Prepare the error message
$error = Lang::get('admin/models/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('models')->with('error', $error);
}
}
}
public function getClone($modelId = null)
{
// Check if the model exists
if (is_null($model_to_clone = Model::find($modelId))) {
// Redirect to the model management page
return Redirect::to('assets/models')->with('error', Lang::get('admin/models/message.does_not_exist'));
}
$model = clone $model_to_clone;
$model->id = null;
// Show the page
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$view = View::make('backend/models/edit');
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
$view->with('manufacturer_list',$manufacturer_list);
$view->with('model',$model);
$view->with('clone_model',$model_to_clone);
return $view;
}
}
+68 -70
View File
@@ -11,93 +11,91 @@ use Str;
use Validator;
use View;
class SettingsController extends AdminController {
class SettingsController extends AdminController
{
/**
* Show a list of all the settings.
*
* @return View
*/
/**
* Show a list of all the settings.
*
* @return View
*/
public function getIndex()
{
// Grab all the settings
$settings = Setting::all();
public function getIndex()
{
// Grab all the settings
$settings = Setting::all();
// Show the page
return View::make('backend/settings/index', compact('settings'));
}
// Show the page
return View::make('backend/settings/index', compact('settings'));
}
/**
* Setting update.
*
* @param int $settingId
* @return View
*/
public function getEdit()
{
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
$is_gd_installed = extension_loaded('gd');
return View::make('backend/settings/edit', compact('settings', 'is_gd_installed'));
}
/**
* Setting update.
*
* @param int $settingId
* @return View
*/
public function getEdit()
{
$settings = Setting::orderBy('created_at', 'DESC')->paginate(10);
$is_gd_installed = extension_loaded('gd');
return View::make('backend/settings/edit', compact('settings', 'is_gd_installed'));
}
/**
* Setting update form processing page.
*
* @param int $settingId
* @return Redirect
*/
public function postEdit()
{
/**
* Setting update form processing page.
*
* @param int $settingId
* @return Redirect
*/
public function postEdit()
{
// Check if the asset exists
if (is_null($setting = Setting::find(1)))
{
// Redirect to the asset management page with error
return Redirect::to('admin')->with('error', Lang::get('admin/settings/message.update.error'));
}
// Check if the asset exists
if (is_null($setting = Setting::find(1))) {
// Redirect to the asset management page with error
return Redirect::to('admin')->with('error', Lang::get('admin/settings/message.update.error'));
}
$new = Input::all();
$new = Input::all();
// Declare the rules for the form validation
$rules = array(
"site_name" => 'required|min:3',
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31'
);
// Declare the rules for the form validation
$rules = array(
"site_name" => 'required|min:3',
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31'
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails())
{
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Update the asset data
$setting->id = '1';
$setting->site_name = e(Input::get('site_name'));
$setting->per_page = e(Input::get('per_page'));
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->qr_text = e(Input::get('qr_text'));
// Update the asset data
$setting->id = '1';
$setting->site_name = e(Input::get('site_name'));
$setting->display_asset_name = e(Input::get('display_asset_name', '0'));
$setting->per_page = e(Input::get('per_page'));
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->qr_text = e(Input::get('qr_text'));
// Was the asset updated?
if($setting->save())
{
// Redirect to the settings page
return Redirect::to("admin/settings/app")->with('success', Lang::get('admin/settings/message.update.success'));
}
// Was the asset updated?
if($setting->save()) {
// Redirect to the settings page
return Redirect::to("admin/settings/app")->with('success', Lang::get('admin/settings/message.update.success'));
}
// Redirect to the setting management page
return Redirect::to("admin/settings/app/edit")->with('error', Lang::get('admin/settings/message.update.error'));
// Redirect to the setting management page
return Redirect::to("admin/settings/app/edit")->with('error', Lang::get('admin/settings/message.update.error'));
}
}
+134 -148
View File
@@ -12,176 +12,162 @@ use Str;
use Validator;
use View;
class StatuslabelsController extends AdminController {
class StatuslabelsController extends AdminController
{
/**
* Show a list of all the statuslabels.
*
* @return View
*/
/**
* Show a list of all the statuslabels.
*
* @return View
*/
public function getIndex()
{
// Grab all the statuslabels
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->paginate(10);
public function getIndex()
{
// Grab all the statuslabels
$statuslabels = Statuslabel::orderBy('created_at', 'DESC')->paginate(10);
// Show the page
return View::make('backend/statuslabels/index', compact('statuslabels'));
}
// Show the page
return View::make('backend/statuslabels/index', compact('statuslabels'));
}
/**
* Statuslabel create.
*
* @return View
*/
public function getCreate()
{
// Show the page
return View::make('backend/statuslabels/edit')->with('statuslabel',new Statuslabel);
}
/**
* Statuslabel create.
*
* @return View
*/
public function getCreate()
{
// Show the page
return View::make('backend/statuslabels/edit')->with('statuslabel',new Statuslabel);
}
/**
* Statuslabel create form processing.
*
* @return Redirect
*/
public function postCreate()
{
/**
* Statuslabel create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// get the POST data
$new = Input::all();
// create a new model instance
$statuslabel = new Statuslabel();
// create a new model instance
$statuslabel = new Statuslabel();
// attempt validation
if ($statuslabel->validate($new))
{
// attempt validation
if ($statuslabel->validate($new)) {
// Save the Statuslabel data
$statuslabel->name = e(Input::get('name'));
$statuslabel->user_id = Sentry::getId();
// Save the Statuslabel data
$statuslabel->name = e(Input::get('name'));
$statuslabel->user_id = Sentry::getId();
// Was the asset created?
if($statuslabel->save())
{
// Redirect to the new Statuslabel page
return Redirect::to("admin/settings/statuslabels")->with('success', Lang::get('admin/statuslabels/message.create.success'));
}
}
else
{
// failure
$errors = $statuslabel->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Was the asset created?
if($statuslabel->save()) {
// Redirect to the new Statuslabel page
return Redirect::to("admin/settings/statuslabels")->with('success', Lang::get('admin/statuslabels/message.create.success'));
}
} else {
// failure
$errors = $statuslabel->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the Statuslabel create page
return Redirect::to('admin/settings/statuslabels/create')->with('error', Lang::get('admin/statuslabels/message.create.error'));
// Redirect to the Statuslabel create page
return Redirect::to('admin/settings/statuslabels/create')->with('error', Lang::get('admin/statuslabels/message.create.error'));
}
}
/**
* Statuslabel update.
*
* @param int $statuslabelId
* @return View
*/
public function getEdit($statuslabelId = null)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
}
/**
* Statuslabel update.
*
* @param int $statuslabelId
* @return View
*/
public function getEdit($statuslabelId = null)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
}
return View::make('backend/statuslabels/edit', compact('statuslabel'));
}
return View::make('backend/statuslabels/edit', compact('statuslabel'));
}
/**
* Statuslabel update form processing page.
*
* @param int $statuslabelId
* @return Redirect
*/
public function postEdit($statuslabelId = null)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
}
/**
* Statuslabel update form processing page.
*
* @param int $statuslabelId
* @return Redirect
*/
public function postEdit($statuslabelId = null)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.does_not_exist'));
}
//attempt to validate
$validator = Validator::make(Input::all(), $statuslabel->validationRules($statuslabelId));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the Statuslabel data
$statuslabel->name = e(Input::get('name'));
// Was the asset created?
if($statuslabel->save()) {
// Redirect to the saved Statuslabel page
return Redirect::to("admin/settings/statuslabels/")->with('success', Lang::get('admin/statuslabels/message.update.success'));
}
}
// Redirect to the Statuslabel management page
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
}
/**
* Delete the given Statuslabel.
*
* @param int $statuslabelId
* @return Redirect
*/
public function getDelete($statuslabelId)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.not_found'));
}
if ($statuslabel->has_assets() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.assoc_users'));
} else {
$statuslabel->delete();
// Redirect to the statuslabels management page
return Redirect::to('admin/settings/statuslabels')->with('success', Lang::get('admin/statuslabels/message.delete.success'));
}
// get the POST data
$new = Input::all();
// attempt validation
if ($statuslabel->validate($new))
{
// Update the Statuslabel data
$statuslabel->name = e(Input::get('name'));
// Was the asset created?
if($statuslabel->save())
{
// Redirect to the saved Statuslabel page
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('success', Lang::get('admin/statuslabels/message.update.success'));
}
}
else
{
// failure
$errors = $statuslabel->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the Statuslabel management page
return Redirect::to("admin/settings/statuslabels/$statuslabelId/edit")->with('error', Lang::get('admin/statuslabels/message.update.error'));
}
/**
* Delete the given Statuslabel.
*
* @param int $statuslabelId
* @return Redirect
*/
public function getDelete($statuslabelId)
{
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId)))
{
// Redirect to the blogs management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.not_found'));
}
if ($statuslabel->has_assets() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/statuslabels')->with('error', Lang::get('admin/statuslabels/message.assoc_users'));
} else {
$statuslabel->delete();
// Redirect to the statuslabels management page
return Redirect::to('admin/settings/statuslabels')->with('success', Lang::get('admin/statuslabels/message.delete.success'));
}
}
}
+219
View File
@@ -0,0 +1,219 @@
<?php namespace Controllers\Admin;
use AdminController;
use Input;
use Lang;
use Supplier;
use Redirect;
use Setting;
use Sentry;
use Str;
use Validator;
use View;
class SuppliersController extends AdminController
{
/**
* Show a list of all suppliers
*
* @return View
*/
public function getIndex()
{
// Grab all the suppliers
$suppliers = Supplier::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/suppliers/index', compact('suppliers'));
}
/**
* Supplier create.
*
* @return View
*/
public function getCreate()
{
return View::make('backend/suppliers/edit')->with('supplier', new Supplier);
}
/**
* Supplier create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// Create a new supplier
$supplier = new Supplier;
// attempt validation
if ($supplier->validate($new)) {
// Save the location data
$supplier->name = e(Input::get('name'));
$supplier->address = e(Input::get('address'));
$supplier->address2 = e(Input::get('address2'));
$supplier->city = e(Input::get('city'));
$supplier->state = e(Input::get('state'));
$supplier->country = e(Input::get('country'));
$supplier->zip = e(Input::get('zip'));
$supplier->contact = e(Input::get('contact'));
$supplier->phone = e(Input::get('phone'));
$supplier->fax = e(Input::get('fax'));
$supplier->email = e(Input::get('email'));
$supplier->notes = e(Input::get('notes'));
$supplier->url = $supplier->addhttp(e(Input::get('url')));
$supplier->user_id = Sentry::getId();
// Was it created?
if($supplier->save()) {
// Redirect to the new supplier page
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.create.success'));
}
} else {
// failure
$errors = $supplier->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the supplier create page
return Redirect::to('admin/settings/suppliers/create')->with('error', Lang::get('admin/suppliers/message.create.error'));
}
/**
* Supplier update.
*
* @param int $supplierId
* @return View
*/
public function getEdit($supplierId = null)
{
// Check if the supplier exists
if (is_null($supplier = Supplier::find($supplierId))) {
// Redirect to the supplier page
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.does_not_exist'));
}
// Show the page
return View::make('backend/suppliers/edit', compact('supplier'));
}
/**
* Supplier update form processing page.
*
* @param int $supplierId
* @return Redirect
*/
public function postEdit($supplierId = null)
{
// Check if the supplier exists
if (is_null($supplier = Supplier::find($supplierId))) {
// Redirect to the supplier page
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.does_not_exist'));
}
//attempt to validate
$validator = Validator::make(Input::all(), $supplier->validationRules($supplierId));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Save the data
$supplier->name = e(Input::get('name'));
$supplier->address = e(Input::get('address'));
$supplier->address2 = e(Input::get('address2'));
$supplier->city = e(Input::get('city'));
$supplier->state = e(Input::get('state'));
$supplier->country = e(Input::get('country'));
$supplier->zip = e(Input::get('zip'));
$supplier->contact = e(Input::get('contact'));
$supplier->phone = e(Input::get('phone'));
$supplier->fax = e(Input::get('fax'));
$supplier->email = e(Input::get('email'));
$supplier->url = $supplier->addhttp(e(Input::get('url')));
$supplier->notes = e(Input::get('notes'));
// Was it created?
if($supplier->save()) {
// Redirect to the new supplier page
return Redirect::to("admin/settings/suppliers")->with('success', Lang::get('admin/suppliers/message.update.success'));
}
}
// Redirect to the supplier management page
return Redirect::to("admin/settings/suppliers/$supplierId/edit")->with('error', Lang::get('admin/suppliers/message.update.error'));
}
/**
* Delete the given supplier.
*
* @param int $supplierId
* @return Redirect
*/
public function getDelete($supplierId)
{
// Check if the supplier exists
if (is_null($supplier = Supplier::find($supplierId))) {
// Redirect to the suppliers page
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.not_found'));
}
if ($supplier->num_assets() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/suppliers')->with('error', Lang::get('admin/suppliers/message.assoc_users'));
} else {
// Delete the supplier
$supplier->delete();
// Redirect to the suppliers management page
return Redirect::to('admin/settings/suppliers')->with('success', Lang::get('admin/suppliers/message.delete.success'));
}
}
/**
* Get the asset information to present to the supplier view page
*
* @param int $assetId
* @return View
**/
public function getView($supplierId = null)
{
$supplier = Supplier::find($supplierId);
if (isset($supplier->id)) {
return View::make('backend/suppliers/view', compact('supplier'));
} else {
// Prepare the error message
$error = Lang::get('admin/suppliers/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('suppliers')->with('error', $error);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -2,37 +2,35 @@
use Illuminate\Database\Migrations\Migration;
class UpdateUsersTable extends Migration {
class UpdateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Update the users table
Schema::table('users', function ($table) {
$table->softDeletes();
$table->string('website')->nullable();
$table->string('country')->nullable();
$table->string('gravatar')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Update the users table
Schema::table('users', function($table)
{
$table->softDeletes();
$table->string('website')->nullable();
$table->string('country')->nullable();
$table->string('gravatar')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Update the users table
Schema::table('users', function($table)
{
$table->dropColumn('deleted_at', 'website', 'country', 'gravatar');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Update the users table
Schema::table('users', function ($table) {
$table->dropColumn('deleted_at', 'website', 'country', 'gravatar');
});
}
}
+28 -29
View File
@@ -2,34 +2,33 @@
use Illuminate\Database\Migrations\Migration;
class CreateModelsTable extends Migration {
class CreateModelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('models', function ($table) {
$table->increments('id');
$table->string('name');
$table->string('modelno');
$table->integer('manufacturer_id')->nullable();
$table->integer('category_id')->nullable();
$table->timestamps();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('models', function($table)
{
$table->increments('id');
$table->string('name');
$table->string('modelno');
$table->integer('manufacturer_id')->nullable();
$table->integer('category_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('models');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('models');
}
}
}
+25 -26
View File
@@ -2,32 +2,31 @@
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration {
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function($table)
{
$table->increments('id');
$table->string('name');
$table->integer('parent')->default(0);
$table->timestamps();
});
}
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function ($table) {
$table->increments('id');
$table->string('name');
$table->integer('parent')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
}
}
+25 -26
View File
@@ -2,31 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class CreateManufacturersTable extends Migration {
class CreateManufacturersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('manufacturers', function ($table) {
$table->increments('id');
$table->string('name');
$table->timestamps();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('manufacturers', function($table)
{
$table->increments('id');
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('manufacturers');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('manufacturers');
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddUserIdToCategories extends Migration {
class AddUserIdToCategories extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function ($table) {
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function($table)
{
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddUserIdToManufacturers extends Migration {
class AddUserIdToManufacturers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('manufacturers', function ($table) {
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('manufacturers', function($table)
{
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+34 -35
View File
@@ -2,40 +2,39 @@
use Illuminate\Database\Migrations\Migration;
class CreateAssetsTable extends Migration {
class CreateAssetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('assets', function ($table) {
$table->increments('id');
$table->string('name');
$table->string('asset_tag')->nullable();
$table->integer('model_id');
$table->string('serial');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('assets', function($table)
{
$table->increments('id');
$table->string('name');
$table->string('asset_tag')->nullable();
$table->integer('model_id');
$table->string('serial');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('assets');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('assets');
}
}
}
+35 -36
View File
@@ -2,41 +2,40 @@
use Illuminate\Database\Migrations\Migration;
class CreateLicensesTable extends Migration {
class CreateLicensesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('licenses', function ($table) {
$table->increments('id');
$table->string('name');
$table->integer('model_id');
$table->string('serial');
$table->string('license_email');
$table->string('license_name');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('licenses', function($table)
{
$table->increments('id');
$table->string('name');
$table->integer('model_id');
$table->string('serial');
$table->string('license_email');
$table->string('license_name');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('licenses');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('licenses');
}
}
}
+20 -20
View File
@@ -2,26 +2,26 @@
use Illuminate\Database\Migrations\Migration;
class AddLicenseNameToLicenses extends Migration {
class AddLicenseNameToLicenses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+28 -29
View File
@@ -2,34 +2,33 @@
use Illuminate\Database\Migrations\Migration;
class CreateDepreciationsTable extends Migration {
class CreateDepreciationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('depreciations', function ($table) {
$table->increments('id');
$table->string('name');
$table->integer('months');
$table->timestamps();
$table->integer('user_id');
//$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('depreciations', function($table)
{
$table->increments('id');
$table->string('name');
$table->integer('months');
$table->timestamps();
$table->integer('user_id');
//$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('depreciations');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('depreciations');
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddDepreciationIdToModels extends Migration {
class AddDepreciationIdToModels extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function ($table) {
$table->integer('depreciation_id')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function($table)
{
$table->integer('depreciation_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddUserIdToModels extends Migration {
class AddUserIdToModels extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function ($table) {
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('models', function($table)
{
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+29 -30
View File
@@ -2,35 +2,34 @@
use Illuminate\Database\Migrations\Migration;
class CreateLocationsTable extends Migration {
class CreateLocationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('locations', function ($table) {
$table->increments('id');
$table->string('name');
$table->string('city');
$table->string('state',2);
$table->string('country',2);
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('locations', function($table)
{
$table->increments('id');
$table->string('name');
$table->string('city');
$table->string('state',2);
$table->string('country',2);
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('locations');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('locations');
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddLocationIdToAssets extends Migration {
class AddLocationIdToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->integer('location_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->integer('location_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddCheckedoutToToAssets extends Migration {
class AddCheckedoutToToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->integer('checkedout_to');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->integer('checkedout_to');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+27 -28
View File
@@ -2,33 +2,32 @@
use Illuminate\Database\Migrations\Migration;
class CreateHistoryTable extends Migration {
class CreateHistoryTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('history', function ($table) {
$table->increments('id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('history', function($table)
{
$table->increments('id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('history');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('history');
}
}
}
+21 -21
View File
@@ -2,26 +2,26 @@
use Illuminate\Database\Migrations\Migration;
class DropLicensesTable extends Migration {
class DropLicensesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::drop('licenses');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::drop('licenses');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+25 -26
View File
@@ -2,32 +2,31 @@
use Illuminate\Database\Migrations\Migration;
class AddPhysicalToAssets extends Migration {
class AddPhysicalToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('assets', function ($table) {
$table->boolean('physical')->default(1);
$table->dropColumn('checkedout_to')->nullable();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('assets', function($table)
{
$table->boolean('physical')->default(1);
$table->dropColumn('checkedout_to')->nullable();
});
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+28 -29
View File
@@ -2,34 +2,33 @@
use Illuminate\Database\Migrations\Migration;
class CreateSettingsTable extends Migration {
class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('settings', function ($table) {
$table->increments('id');
$table->string('option_name');
$table->string('option_value');
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('settings', function($table)
{
$table->increments('id');
$table->string('option_name');
$table->string('option_value');
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings');
}
}
}
+24 -25
View File
@@ -2,30 +2,29 @@
use Illuminate\Database\Migrations\Migration;
class AddLicenseToAssets extends Migration {
class AddLicenseToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->string('license_name')->nullable();
$table->string('license_email')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->string('license_name')->nullable();
$table->string('license_email')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+29 -31
View File
@@ -2,39 +2,37 @@
use Illuminate\Database\Migrations\Migration;
class AddContactsToUsers extends Migration {
class AddContactsToUsers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function ($table) {
$table->integer('location_id')->nullable();
$table->string('phone');
$table->string('jobtitle');
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function($table)
{
$table->integer('location_id')->nullable();
$table->string('phone');
$table->string('jobtitle');
});
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function ($table) {
$table->dropColumn('location_id');
$table->dropColumn('phone');
$table->dropColumn('jobtitle');
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function($table)
{
$table->dropColumn('location_id');
$table->dropColumn('phone');
$table->dropColumn('jobtitle');
});
});
}
}
}
}
+29 -31
View File
@@ -2,40 +2,38 @@
use Illuminate\Database\Migrations\Migration;
class AddInfoToLocations extends Migration {
class AddInfoToLocations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function ($table) {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function($table)
{
$table->string('address', 80);
$table->string('address2', 80);
$table->string('zip', 10);
$table->string('address', 80);
$table->string('address2', 80);
$table->string('zip', 10);
});
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function ($table) {
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function($table)
{
$table->dropColumn('address');
$table->dropColumn('address2');
$table->dropColumn('zip');
$table->dropColumn('address');
$table->dropColumn('address2');
$table->dropColumn('zip');
});
}
});
}
}
}
+25 -27
View File
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class RemoveLocationIdFromAsset extends Migration {
class RemoveLocationIdFromAsset extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->dropColumn('location_id');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->dropColumn('location_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function ($table) {
$table->integer('location_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function($table)
{
$table->integer('location_id');
});
}
}
}
+23 -23
View File
@@ -2,30 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class SetNullvaluesForUser extends Migration {
class SetNullvaluesForUser extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
DB::statement('ALTER TABLE users MODIFY phone varchar(20) null');
DB::statement('ALTER TABLE users MODIFY jobtitle varchar(50) null');
DB::statement('ALTER TABLE users MODIFY phone varchar(20) null');
DB::statement('ALTER TABLE users MODIFY jobtitle varchar(50) null');
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+29 -30
View File
@@ -2,35 +2,34 @@
use Illuminate\Database\Migrations\Migration;
class CreateAssetLogsTable extends Migration {
class CreateAssetLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('asset_logs', function ($table) {
$table->increments('id');
$table->integer('user_id');
$table->string('action_type');
$table->integer('asset_id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamp('added_on');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('asset_logs', function($table)
{
$table->increments('id');
$table->integer('user_id');
$table->string('action_type');
$table->integer('asset_id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamp('added_on');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('asset_logs');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('asset_logs');
}
}
}
+21 -21
View File
@@ -2,27 +2,27 @@
use Illuminate\Database\Migrations\Migration;
class EditAddedOnAssetLogsTable extends Migration {
class EditAddedOnAssetLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp null');
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp null');
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+22 -23
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class EditLocationIdAssetLogsTable extends Migration {
class EditLocationIdAssetLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY location_id int(11) null');
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY location_id int(11) null');
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP');
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddSoftDeleteOnAssets extends Migration {
class AddSoftDeleteOnAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddSoftDeleteOnLocations extends Migration {
class AddSoftDeleteOnLocations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function ($table) {
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function($table)
{
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddSoftDeleteOnManufacturers extends Migration {
class AddSoftDeleteOnManufacturers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('manufacturers', function ($table) {
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('manufacturers', function($table)
{
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+23 -24
View File
@@ -2,29 +2,28 @@
use Illuminate\Database\Migrations\Migration;
class AddSoftDeleteOnCategories extends Migration {
class AddSoftDeleteOnCategories extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function ($table) {
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function($table)
{
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+27 -28
View File
@@ -2,33 +2,32 @@
use Illuminate\Database\Migrations\Migration;
class CreateStatusLabels extends Migration {
class CreateStatusLabels extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('status_labels', function ($table) {
$table->increments('id');
$table->string('name',100);
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('status_labels', function($table)
{
$table->increments('id');
$table->string('name',100);
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('status_labels');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('status_labels');
}
}
}
+25 -27
View File
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class AddStatusIdOnAssetsTable extends Migration {
class AddStatusIdOnAssetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->integer('status_id')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->integer('status_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function ($table) {
$table->dropColumn('status_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function($table)
{
$table->dropColumn('status_id');
});
}
}
}
+25 -27
View File
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class AddStatusTypeOnStatusLabels extends Migration {
class AddStatusTypeOnStatusLabels extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('status_labels', function ($table) {
$table->boolean('deployable');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('status_labels', function($table)
{
$table->boolean('deployable');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('status_labels', function ($table) {
$table->dropColumn('deployable');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('status_labels', function($table)
{
$table->dropColumn('deployable');
});
}
}
}
+25 -27
View File
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class AddArchivedToAssets extends Migration {
class AddArchivedToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function ($table) {
$table->boolean('archived');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->boolean('archived');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function ($table) {
$table->dropColumn('archived');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function($table)
{
$table->dropColumn('archived');
});
}
}
}
+29 -30
View File
@@ -2,35 +2,34 @@
use Illuminate\Database\Migrations\Migration;
class AddUploadsTable extends Migration {
class AddUploadsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('asset_uploads', function ($table) {
$table->increments('id');
$table->integer('user_id');
$table->string('filename');
$table->integer('asset_id');
$table->string('filenotes')->nullable;
$table->timestamps();
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('asset_uploads', function($table)
{
$table->increments('id');
$table->integer('user_id');
$table->string('filename');
$table->integer('asset_id');
$table->string('filenotes')->nullable;
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('asset_uploads');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('asset_uploads');
}
}
}
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class RemoveDeployableBooleanFromStatusLabels extends Migration {
class RemoveDeployableBooleanFromStatusLabels extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('status_labels', function ($table) {
$table->dropColumn('deployable');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('status_labels', function($table)
{
$table->dropColumn('deployable');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('status_labels', function ($table) {
$table->boolean('deployable');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('status_labels', function($table)
{
$table->boolean('deployable');
});
}
}
}
+25 -27
View File
@@ -2,32 +2,30 @@
use Illuminate\Database\Migrations\Migration;
class AddOptionLabelToSettingsTable extends Migration {
class AddOptionLabelToSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function ($table) {
$table->string('option_label','80')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function($table)
{
$table->string('option_label','80')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function ($table) {
$table->dropColumn('option_label');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function($table)
{
$table->dropColumn('option_label');
});
}
}
}
+27 -28
View File
@@ -2,35 +2,34 @@
use Illuminate\Database\Migrations\Migration;
class EditsToSettingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function($table)
{
$table->dropColumn('option_label');
$table->dropColumn('option_name');
$table->dropColumn('option_value');
$table->integer('per_page')->default(20);
$table->string('site_name','100')->default("Snipe IT Asset Management");
});
class EditsToSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function ($table) {
$table->dropColumn('option_label');
$table->dropColumn('option_name');
$table->dropColumn('option_value');
$table->integer('per_page')->default(20);
$table->string('site_name','100')->default("Snipe IT Asset Management");
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}
+36 -37
View File
@@ -2,42 +2,41 @@
use Illuminate\Database\Migrations\Migration;
class ReCreateLicensesTable extends Migration {
class ReCreateLicensesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('licenses', function ($table) {
$table->increments('id');
$table->string('name');
$table->string('serial');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('seats');
$table->text('notes');
$table->integer('user_id');
$table->integer('depreciation_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('licenses', function($table)
{
$table->increments('id');
$table->string('name');
$table->string('serial');
$table->date('purchase_date')->nullable();
$table->decimal('purchase_cost', 8, 2)->nullable();
$table->string('order_number');
$table->integer('seats');
$table->text('notes');
$table->integer('user_id');
$table->integer('depreciation_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('licenses');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('licenses');
}
}
}
+30 -31
View File
@@ -2,36 +2,35 @@
use Illuminate\Database\Migrations\Migration;
class CreateLicenseSeatsTable extends Migration {
class CreateLicenseSeatsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('license_seats', function ($table) {
$table->increments('id');
$table->integer('license_id');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('license_seats', function($table)
{
$table->increments('id');
$table->integer('license_id');
$table->integer('assigned_to');
$table->text('notes');
$table->integer('user_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
}

Some files were not shown because too many files have changed in this diff Show More