├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── IOS ├── NoteApp.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── tvanderlin.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── tvanderlin.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── NoteApp.xcscheme │ │ └── xcschememanagement.plist ├── NoteApp │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── NoteApp-Info.plist │ ├── NoteApp-Prefix.pch │ ├── NoteCreatorController.h │ ├── NoteCreatorController.m │ ├── NotesController.h │ ├── NotesController.m │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── NoteAppTests │ ├── NoteAppTests-Info.plist │ ├── NoteAppTests.m │ └── en.lproj │ └── InfoPlist.strings ├── README.md ├── app ├── commands │ └── .gitkeep ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── local │ │ ├── app.php │ │ └── database.php │ ├── mail.php │ ├── packages │ │ └── .gitkeep │ ├── queue.php │ ├── remote.php │ ├── services.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── BaseController.php │ ├── HomeController.php │ └── NotesController.php ├── database │ ├── migrations │ │ ├── .gitkeep │ │ └── 2014_06_04_143133_create_notes_table.php │ ├── production.sqlite │ └── seeds │ │ ├── .gitkeep │ │ ├── DatabaseSeeder.php │ │ └── NotesTableSeeder.php ├── filters.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── models │ ├── Note.php │ └── User.php ├── routes.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php └── views │ ├── emails │ └── auth │ │ └── reminder.blade.php │ ├── hello.php │ └── notes │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ └── show.blade.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── composer.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── packages │ └── .gitkeep └── robots.txt └── server.php /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | composer.lock 5 | .env.*.php 6 | .env.php 7 | .DS_Store 8 | Thumbs.db 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository! 4 | -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BAEEAED0193F6C680020E7F8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAECF193F6C680020E7F8 /* Foundation.framework */; }; 11 | BAEEAED2193F6C680020E7F8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAED1193F6C680020E7F8 /* CoreGraphics.framework */; }; 12 | BAEEAED4193F6C680020E7F8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAED3193F6C680020E7F8 /* UIKit.framework */; }; 13 | BAEEAEDA193F6C680020E7F8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BAEEAED8193F6C680020E7F8 /* InfoPlist.strings */; }; 14 | BAEEAEDC193F6C680020E7F8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BAEEAEDB193F6C680020E7F8 /* main.m */; }; 15 | BAEEAEE0193F6C680020E7F8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BAEEAEDF193F6C680020E7F8 /* AppDelegate.m */; }; 16 | BAEEAEE3193F6C680020E7F8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BAEEAEE1193F6C680020E7F8 /* Main.storyboard */; }; 17 | BAEEAEE8193F6C680020E7F8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BAEEAEE7193F6C680020E7F8 /* Images.xcassets */; }; 18 | BAEEAEEF193F6C680020E7F8 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAEEE193F6C680020E7F8 /* XCTest.framework */; }; 19 | BAEEAEF0193F6C680020E7F8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAECF193F6C680020E7F8 /* Foundation.framework */; }; 20 | BAEEAEF1193F6C680020E7F8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAEEAED3193F6C680020E7F8 /* UIKit.framework */; }; 21 | BAEEAEF9193F6C680020E7F8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BAEEAEF7193F6C680020E7F8 /* InfoPlist.strings */; }; 22 | BAEEAEFB193F6C680020E7F8 /* NoteAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAEEAEFA193F6C680020E7F8 /* NoteAppTests.m */; }; 23 | BAEEAF06193F6E3F0020E7F8 /* NotesController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAEEAF05193F6E3F0020E7F8 /* NotesController.m */; }; 24 | BAEEAF09193FA0600020E7F8 /* NoteCreatorController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAEEAF08193FA0600020E7F8 /* NoteCreatorController.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | BAEEAEF2193F6C680020E7F8 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = BAEEAEC4193F6C680020E7F8 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = BAEEAECB193F6C680020E7F8; 33 | remoteInfo = NoteApp; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | BAEEAECC193F6C680020E7F8 /* NoteApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NoteApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | BAEEAECF193F6C680020E7F8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | BAEEAED1193F6C680020E7F8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | BAEEAED3193F6C680020E7F8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | BAEEAED7193F6C680020E7F8 /* NoteApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NoteApp-Info.plist"; sourceTree = ""; }; 43 | BAEEAED9193F6C680020E7F8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | BAEEAEDB193F6C680020E7F8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | BAEEAEDD193F6C680020E7F8 /* NoteApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NoteApp-Prefix.pch"; sourceTree = ""; }; 46 | BAEEAEDE193F6C680020E7F8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | BAEEAEDF193F6C680020E7F8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | BAEEAEE2193F6C680020E7F8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | BAEEAEE7193F6C680020E7F8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 50 | BAEEAEED193F6C680020E7F8 /* NoteAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NoteAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | BAEEAEEE193F6C680020E7F8 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 52 | BAEEAEF6193F6C680020E7F8 /* NoteAppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NoteAppTests-Info.plist"; sourceTree = ""; }; 53 | BAEEAEF8193F6C680020E7F8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 54 | BAEEAEFA193F6C680020E7F8 /* NoteAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NoteAppTests.m; sourceTree = ""; }; 55 | BAEEAF04193F6E3F0020E7F8 /* NotesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotesController.h; sourceTree = ""; }; 56 | BAEEAF05193F6E3F0020E7F8 /* NotesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotesController.m; sourceTree = ""; }; 57 | BAEEAF07193FA0600020E7F8 /* NoteCreatorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoteCreatorController.h; sourceTree = ""; }; 58 | BAEEAF08193FA0600020E7F8 /* NoteCreatorController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoteCreatorController.m; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | BAEEAEC9193F6C680020E7F8 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | BAEEAED2193F6C680020E7F8 /* CoreGraphics.framework in Frameworks */, 67 | BAEEAED4193F6C680020E7F8 /* UIKit.framework in Frameworks */, 68 | BAEEAED0193F6C680020E7F8 /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | BAEEAEEA193F6C680020E7F8 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | BAEEAEEF193F6C680020E7F8 /* XCTest.framework in Frameworks */, 77 | BAEEAEF1193F6C680020E7F8 /* UIKit.framework in Frameworks */, 78 | BAEEAEF0193F6C680020E7F8 /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | BAEEAEC3193F6C680020E7F8 = { 86 | isa = PBXGroup; 87 | children = ( 88 | BAEEAED5193F6C680020E7F8 /* NoteApp */, 89 | BAEEAEF4193F6C680020E7F8 /* NoteAppTests */, 90 | BAEEAECE193F6C680020E7F8 /* Frameworks */, 91 | BAEEAECD193F6C680020E7F8 /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | BAEEAECD193F6C680020E7F8 /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | BAEEAECC193F6C680020E7F8 /* NoteApp.app */, 99 | BAEEAEED193F6C680020E7F8 /* NoteAppTests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | BAEEAECE193F6C680020E7F8 /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | BAEEAECF193F6C680020E7F8 /* Foundation.framework */, 108 | BAEEAED1193F6C680020E7F8 /* CoreGraphics.framework */, 109 | BAEEAED3193F6C680020E7F8 /* UIKit.framework */, 110 | BAEEAEEE193F6C680020E7F8 /* XCTest.framework */, 111 | ); 112 | name = Frameworks; 113 | sourceTree = ""; 114 | }; 115 | BAEEAED5193F6C680020E7F8 /* NoteApp */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | BAEEAF07193FA0600020E7F8 /* NoteCreatorController.h */, 119 | BAEEAF08193FA0600020E7F8 /* NoteCreatorController.m */, 120 | BAEEAF04193F6E3F0020E7F8 /* NotesController.h */, 121 | BAEEAF05193F6E3F0020E7F8 /* NotesController.m */, 122 | BAEEAEDE193F6C680020E7F8 /* AppDelegate.h */, 123 | BAEEAEDF193F6C680020E7F8 /* AppDelegate.m */, 124 | BAEEAEE1193F6C680020E7F8 /* Main.storyboard */, 125 | BAEEAEE7193F6C680020E7F8 /* Images.xcassets */, 126 | BAEEAED6193F6C680020E7F8 /* Supporting Files */, 127 | ); 128 | path = NoteApp; 129 | sourceTree = ""; 130 | }; 131 | BAEEAED6193F6C680020E7F8 /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | BAEEAED7193F6C680020E7F8 /* NoteApp-Info.plist */, 135 | BAEEAED8193F6C680020E7F8 /* InfoPlist.strings */, 136 | BAEEAEDB193F6C680020E7F8 /* main.m */, 137 | BAEEAEDD193F6C680020E7F8 /* NoteApp-Prefix.pch */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | BAEEAEF4193F6C680020E7F8 /* NoteAppTests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | BAEEAEFA193F6C680020E7F8 /* NoteAppTests.m */, 146 | BAEEAEF5193F6C680020E7F8 /* Supporting Files */, 147 | ); 148 | path = NoteAppTests; 149 | sourceTree = ""; 150 | }; 151 | BAEEAEF5193F6C680020E7F8 /* Supporting Files */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | BAEEAEF6193F6C680020E7F8 /* NoteAppTests-Info.plist */, 155 | BAEEAEF7193F6C680020E7F8 /* InfoPlist.strings */, 156 | ); 157 | name = "Supporting Files"; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | BAEEAECB193F6C680020E7F8 /* NoteApp */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = BAEEAEFE193F6C680020E7F8 /* Build configuration list for PBXNativeTarget "NoteApp" */; 166 | buildPhases = ( 167 | BAEEAEC8193F6C680020E7F8 /* Sources */, 168 | BAEEAEC9193F6C680020E7F8 /* Frameworks */, 169 | BAEEAECA193F6C680020E7F8 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = NoteApp; 176 | productName = NoteApp; 177 | productReference = BAEEAECC193F6C680020E7F8 /* NoteApp.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | BAEEAEEC193F6C680020E7F8 /* NoteAppTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = BAEEAF01193F6C680020E7F8 /* Build configuration list for PBXNativeTarget "NoteAppTests" */; 183 | buildPhases = ( 184 | BAEEAEE9193F6C680020E7F8 /* Sources */, 185 | BAEEAEEA193F6C680020E7F8 /* Frameworks */, 186 | BAEEAEEB193F6C680020E7F8 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | BAEEAEF3193F6C680020E7F8 /* PBXTargetDependency */, 192 | ); 193 | name = NoteAppTests; 194 | productName = NoteAppTests; 195 | productReference = BAEEAEED193F6C680020E7F8 /* NoteAppTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | BAEEAEC4193F6C680020E7F8 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 0510; 205 | ORGANIZATIONNAME = IDEO; 206 | TargetAttributes = { 207 | BAEEAEEC193F6C680020E7F8 = { 208 | TestTargetID = BAEEAECB193F6C680020E7F8; 209 | }; 210 | }; 211 | }; 212 | buildConfigurationList = BAEEAEC7193F6C680020E7F8 /* Build configuration list for PBXProject "NoteApp" */; 213 | compatibilityVersion = "Xcode 3.2"; 214 | developmentRegion = English; 215 | hasScannedForEncodings = 0; 216 | knownRegions = ( 217 | en, 218 | Base, 219 | ); 220 | mainGroup = BAEEAEC3193F6C680020E7F8; 221 | productRefGroup = BAEEAECD193F6C680020E7F8 /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | BAEEAECB193F6C680020E7F8 /* NoteApp */, 226 | BAEEAEEC193F6C680020E7F8 /* NoteAppTests */, 227 | ); 228 | }; 229 | /* End PBXProject section */ 230 | 231 | /* Begin PBXResourcesBuildPhase section */ 232 | BAEEAECA193F6C680020E7F8 /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | BAEEAEE8193F6C680020E7F8 /* Images.xcassets in Resources */, 237 | BAEEAEDA193F6C680020E7F8 /* InfoPlist.strings in Resources */, 238 | BAEEAEE3193F6C680020E7F8 /* Main.storyboard in Resources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | BAEEAEEB193F6C680020E7F8 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | BAEEAEF9193F6C680020E7F8 /* InfoPlist.strings in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXSourcesBuildPhase section */ 253 | BAEEAEC8193F6C680020E7F8 /* Sources */ = { 254 | isa = PBXSourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | BAEEAF09193FA0600020E7F8 /* NoteCreatorController.m in Sources */, 258 | BAEEAEE0193F6C680020E7F8 /* AppDelegate.m in Sources */, 259 | BAEEAF06193F6E3F0020E7F8 /* NotesController.m in Sources */, 260 | BAEEAEDC193F6C680020E7F8 /* main.m in Sources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | BAEEAEE9193F6C680020E7F8 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | BAEEAEFB193F6C680020E7F8 /* NoteAppTests.m in Sources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXSourcesBuildPhase section */ 273 | 274 | /* Begin PBXTargetDependency section */ 275 | BAEEAEF3193F6C680020E7F8 /* PBXTargetDependency */ = { 276 | isa = PBXTargetDependency; 277 | target = BAEEAECB193F6C680020E7F8 /* NoteApp */; 278 | targetProxy = BAEEAEF2193F6C680020E7F8 /* PBXContainerItemProxy */; 279 | }; 280 | /* End PBXTargetDependency section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | BAEEAED8193F6C680020E7F8 /* InfoPlist.strings */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | BAEEAED9193F6C680020E7F8 /* en */, 287 | ); 288 | name = InfoPlist.strings; 289 | sourceTree = ""; 290 | }; 291 | BAEEAEE1193F6C680020E7F8 /* Main.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | BAEEAEE2193F6C680020E7F8 /* Base */, 295 | ); 296 | name = Main.storyboard; 297 | sourceTree = ""; 298 | }; 299 | BAEEAEF7193F6C680020E7F8 /* InfoPlist.strings */ = { 300 | isa = PBXVariantGroup; 301 | children = ( 302 | BAEEAEF8193F6C680020E7F8 /* en */, 303 | ); 304 | name = InfoPlist.strings; 305 | sourceTree = ""; 306 | }; 307 | /* End PBXVariantGroup section */ 308 | 309 | /* Begin XCBuildConfiguration section */ 310 | BAEEAEFC193F6C680020E7F8 /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = NO; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_DYNAMIC_NO_PIC = NO; 330 | GCC_OPTIMIZATION_LEVEL = 0; 331 | GCC_PREPROCESSOR_DEFINITIONS = ( 332 | "DEBUG=1", 333 | "$(inherited)", 334 | ); 335 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 343 | ONLY_ACTIVE_ARCH = YES; 344 | SDKROOT = iphoneos; 345 | }; 346 | name = Debug; 347 | }; 348 | BAEEAEFD193F6C680020E7F8 /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = YES; 366 | ENABLE_NS_ASSERTIONS = NO; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 375 | SDKROOT = iphoneos; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | BAEEAEFF193F6C680020E7F8 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 384 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 385 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 386 | GCC_PREFIX_HEADER = "NoteApp/NoteApp-Prefix.pch"; 387 | INFOPLIST_FILE = "NoteApp/NoteApp-Info.plist"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | WRAPPER_EXTENSION = app; 390 | }; 391 | name = Debug; 392 | }; 393 | BAEEAF00193F6C680020E7F8 /* Release */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 398 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 399 | GCC_PREFIX_HEADER = "NoteApp/NoteApp-Prefix.pch"; 400 | INFOPLIST_FILE = "NoteApp/NoteApp-Info.plist"; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | WRAPPER_EXTENSION = app; 403 | }; 404 | name = Release; 405 | }; 406 | BAEEAF02193F6C680020E7F8 /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/NoteApp.app/NoteApp"; 410 | FRAMEWORK_SEARCH_PATHS = ( 411 | "$(SDKROOT)/Developer/Library/Frameworks", 412 | "$(inherited)", 413 | "$(DEVELOPER_FRAMEWORKS_DIR)", 414 | ); 415 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 416 | GCC_PREFIX_HEADER = "NoteApp/NoteApp-Prefix.pch"; 417 | GCC_PREPROCESSOR_DEFINITIONS = ( 418 | "DEBUG=1", 419 | "$(inherited)", 420 | ); 421 | INFOPLIST_FILE = "NoteAppTests/NoteAppTests-Info.plist"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | TEST_HOST = "$(BUNDLE_LOADER)"; 424 | WRAPPER_EXTENSION = xctest; 425 | }; 426 | name = Debug; 427 | }; 428 | BAEEAF03193F6C680020E7F8 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/NoteApp.app/NoteApp"; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(SDKROOT)/Developer/Library/Frameworks", 434 | "$(inherited)", 435 | "$(DEVELOPER_FRAMEWORKS_DIR)", 436 | ); 437 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 438 | GCC_PREFIX_HEADER = "NoteApp/NoteApp-Prefix.pch"; 439 | INFOPLIST_FILE = "NoteAppTests/NoteAppTests-Info.plist"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | TEST_HOST = "$(BUNDLE_LOADER)"; 442 | WRAPPER_EXTENSION = xctest; 443 | }; 444 | name = Release; 445 | }; 446 | /* End XCBuildConfiguration section */ 447 | 448 | /* Begin XCConfigurationList section */ 449 | BAEEAEC7193F6C680020E7F8 /* Build configuration list for PBXProject "NoteApp" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | BAEEAEFC193F6C680020E7F8 /* Debug */, 453 | BAEEAEFD193F6C680020E7F8 /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | BAEEAEFE193F6C680020E7F8 /* Build configuration list for PBXNativeTarget "NoteApp" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | BAEEAEFF193F6C680020E7F8 /* Debug */, 462 | BAEEAF00193F6C680020E7F8 /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | }; 466 | BAEEAF01193F6C680020E7F8 /* Build configuration list for PBXNativeTarget "NoteAppTests" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | BAEEAF02193F6C680020E7F8 /* Debug */, 470 | BAEEAF03193F6C680020E7F8 /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | }; 474 | /* End XCConfigurationList section */ 475 | }; 476 | rootObject = BAEEAEC4193F6C680020E7F8 /* Project object */; 477 | } 478 | -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/project.xcworkspace/xcuserdata/tvanderlin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/IOS/NoteApp.xcodeproj/project.xcworkspace/xcuserdata/tvanderlin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/xcuserdata/tvanderlin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/xcuserdata/tvanderlin.xcuserdatad/xcschemes/NoteApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /IOS/NoteApp.xcodeproj/xcuserdata/tvanderlin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NoteApp.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BAEEAECB193F6C680020E7F8 16 | 17 | primary 18 | 19 | 20 | BAEEAEEC193F6C680020E7F8 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /IOS/NoteApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import 10 | #define BASE_URL @"http://laravelios:8888" 11 | 12 | typedef void(^RequestBlock)(NSDictionary*data); 13 | 14 | // ------------------------------------------------------------------- 15 | @interface AppDelegate : UIResponder 16 | 17 | @property (strong, nonatomic) UIWindow *window; 18 | 19 | +(AppDelegate*)getInstance; 20 | -(void)makeRequest:(NSString*)urlString method:(NSString*)method params:(NSDictionary*)params onComplete:(RequestBlock)callback; 21 | @end 22 | -------------------------------------------------------------------------------- /IOS/NoteApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | 17 | /* 18 | // Test the Request 19 | [self makeRequest:@"notes" params:nil method:@"GET" onComplete:^(NSDictionary *data) { 20 | NSLog(@"Json Loaded: %@", data); 21 | }]; 22 | */ 23 | 24 | // Override point for customization after application launch. 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application 29 | { 30 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 31 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application 35 | { 36 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application 41 | { 42 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application 46 | { 47 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 48 | } 49 | 50 | - (void)applicationWillTerminate:(UIApplication *)application 51 | { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | // ------------------------------------------------------------------- 56 | #pragma mark --- Singleton Instance --- 57 | // ------------------------------------------------------------------- 58 | +(AppDelegate*)getInstance { 59 | return (AppDelegate*)[[UIApplication sharedApplication] delegate]; 60 | } 61 | 62 | // ------------------------------------------------------------------- 63 | #pragma mark --- Request Notes Data --- 64 | // ------------------------------------------------------------------- 65 | -(void)makeRequest:(NSString*)urlString method:(NSString*)method params:(NSDictionary*)params onComplete:(RequestBlock)callback { 66 | 67 | // create the url 68 | NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", BASE_URL, urlString]]; 69 | NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL:url]; 70 | 71 | // set the method (GET/POST/PUT/UPDATE/DELETE) 72 | [request setHTTPMethod:method]; 73 | 74 | // if we have params pull out the key/value and add to header 75 | if(params != nil) { 76 | NSMutableString * body = [[NSMutableString alloc] init]; 77 | for (NSString * key in params.allKeys) { 78 | NSString * value = [params objectForKey:key]; 79 | [body appendFormat:@"%@=%@&", key, value]; 80 | } 81 | [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]]; 82 | } 83 | 84 | // submit the request 85 | [NSURLConnection sendAsynchronousRequest:request 86 | queue:[NSOperationQueue mainQueue] 87 | completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 88 | 89 | // do we have data? 90 | if(data && data.length > 0) { 91 | 92 | NSDictionary * json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; 93 | 94 | // if we have a block lets pass it 95 | if(callback) { 96 | callback(json); 97 | } 98 | 99 | } 100 | 101 | }]; 102 | 103 | } 104 | 105 | 106 | @end 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /IOS/NoteApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /IOS/NoteApp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOS/NoteApp/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /IOS/NoteApp/NoteApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | ideo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /IOS/NoteApp/NoteApp-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /IOS/NoteApp/NoteCreatorController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NoteCreatorController.h 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NotesController.h" 11 | 12 | @interface NoteCreatorController : UIViewController 13 | 14 | @property (strong, nonatomic) UITextView * noteTextView; 15 | @property (weak, nonatomic) NotesController * notesControllerRef; 16 | @property (weak, nonatomic) NSDictionary * noteRef; 17 | @end 18 | -------------------------------------------------------------------------------- /IOS/NoteApp/NoteCreatorController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NoteCreatorController.m 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import "NoteCreatorController.h" 10 | #import "AppDelegate.h" 11 | #import "NotesController.h" 12 | 13 | @interface NoteCreatorController () 14 | 15 | @end 16 | 17 | @implementation NoteCreatorController 18 | 19 | @synthesize noteTextView, notesControllerRef, noteRef; 20 | 21 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 22 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 23 | if (self) { 24 | // Custom initialization 25 | } 26 | return self; 27 | } 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | 32 | 33 | self.view.backgroundColor = [UIColor whiteColor]; 34 | 35 | UIToolbar * toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)]; 36 | 37 | 38 | // close button 39 | UIBarButtonItem * closeBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(close)]; 40 | 41 | // spacer 42 | UIBarButtonItem * spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 43 | 44 | // save button 45 | UIBarButtonItem * saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; 46 | 47 | // delete button 48 | UIBarButtonItem * deleteBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(deleteNote)]; 49 | 50 | // set the items for toolbar 51 | toolbar.items = @[closeBtn, spacer, saveBtn, deleteBtn]; 52 | 53 | [self.view addSubview:toolbar]; 54 | 55 | noteTextView = [[UITextView alloc] initWithFrame:CGRectMake(20, 70, self.view.frame.size.width-40, 170)]; 56 | noteTextView.backgroundColor = [UIColor lightGrayColor]; 57 | noteTextView.delegate = self; 58 | [self.view addSubview:noteTextView]; 59 | 60 | // auto launch the keyboard 61 | if(noteRef == nil) { 62 | [noteTextView becomeFirstResponder]; 63 | } 64 | else { 65 | noteTextView.text = [noteRef objectForKey:@"body"]; 66 | } 67 | } 68 | 69 | -(void)close { 70 | [self dismissViewControllerAnimated:YES completion:nil]; 71 | } 72 | 73 | -(void)save { 74 | 75 | // if the keyboard is up dismiss it 76 | if([noteTextView isFirstResponder]) { 77 | [noteTextView resignFirstResponder]; 78 | } 79 | 80 | NSString * body = noteTextView.text; 81 | 82 | // if we have a note ref then update else save the note 83 | 84 | if(noteRef) { 85 | 86 | // We first create the path notes/{note id} 87 | // The verbs PUT/UPDATE/DELETE are not supported 88 | // with most browsers/clients so we need to pass 89 | // a _method. Laravel knows how to interespt this 90 | // into the correct method. 91 | 92 | NSString * noteURL = [NSString stringWithFormat:@"notes/%@", [noteRef objectForKey:@"id"]]; 93 | [[AppDelegate getInstance] makeRequest:noteURL 94 | method:@"POST" 95 | params:@{@"body": body, @"_method": @"PUT"} 96 | onComplete:^(NSDictionary *data) { 97 | 98 | // we need to dismiss the view controller 99 | // and update the tableview in NotesController 100 | [self dismissViewControllerAnimated:YES completion:^{ 101 | [notesControllerRef updateNote:[data objectForKey:@"note"]]; 102 | }]; 103 | 104 | }]; 105 | 106 | } 107 | else { 108 | [[AppDelegate getInstance] makeRequest:@"notes" 109 | method:@"POST" 110 | params:@{@"body": body} 111 | onComplete:^(NSDictionary *data) { 112 | 113 | // we need to dismiss the view controller 114 | // and update the tableview in NotesController 115 | [self dismissViewControllerAnimated:YES completion:^{ 116 | [notesControllerRef addNewNote:[data objectForKey:@"note"]]; 117 | }]; 118 | 119 | }]; 120 | } 121 | 122 | } 123 | 124 | -(void)deleteNote { 125 | NSString * noteURL = [NSString stringWithFormat:@"notes/%@", [noteRef objectForKey:@"id"]]; 126 | [[AppDelegate getInstance] makeRequest:noteURL 127 | method:@"POST" 128 | params:@{@"_method": @"DELETE"} 129 | onComplete:^(NSDictionary *data) { 130 | 131 | // we need to dismiss the view controller 132 | // and update the tableview in NotesController 133 | [self dismissViewControllerAnimated:YES completion:^{ 134 | [notesControllerRef removeNote:[data objectForKey:@"note"]]; 135 | }]; 136 | 137 | }]; 138 | 139 | } 140 | 141 | - (void)didReceiveMemoryWarning 142 | { 143 | [super didReceiveMemoryWarning]; 144 | // Dispose of any resources that can be recreated. 145 | } 146 | 147 | /* 148 | #pragma mark - Navigation 149 | 150 | // In a storyboard-based application, you will often want to do a little preparation before navigation 151 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 152 | { 153 | // Get the new view controller using [segue destinationViewController]. 154 | // Pass the selected object to the new view controller. 155 | } 156 | */ 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /IOS/NoteApp/NotesController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotesController.h 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotesController : UITableViewController 12 | @property (strong, nonatomic) NSMutableArray * notes; 13 | 14 | -(void)addNewNote:(NSDictionary*)note; 15 | -(void)updateNote:(NSDictionary*)note; 16 | -(void)removeNote:(NSDictionary*)note; 17 | @end 18 | -------------------------------------------------------------------------------- /IOS/NoteApp/NotesController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotesController.m 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import "NotesController.h" 10 | #import "AppDelegate.h" 11 | #import "NoteCreatorController.h" 12 | 13 | @interface NotesController () 14 | 15 | @end 16 | 17 | @implementation NotesController 18 | @synthesize notes; 19 | 20 | - (id)initWithStyle:(UITableViewStyle)style { 21 | self = [super initWithStyle:style]; 22 | if (self) { 23 | // Custom initialization 24 | } 25 | return self; 26 | } 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | 31 | [[AppDelegate getInstance] makeRequest:@"notes" method:@"GET" params:nil onComplete:^(NSDictionary *data) { 32 | 33 | NSLog(@"%@", [data objectForKey:@"notes"]); 34 | if([data objectForKey:@"notes"]) { 35 | notes = [NSMutableArray arrayWithArray:[data objectForKey:@"notes"]]; 36 | 37 | // now reload the tableview 38 | [self.tableView reloadData]; 39 | } 40 | 41 | }]; 42 | 43 | 44 | // Add a new note 45 | UIBarButtonItem * noteButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose 46 | target:self 47 | action:@selector(openNoteCreator:)]; 48 | 49 | self.navigationItem.rightBarButtonItem = noteButton; 50 | 51 | } 52 | 53 | -(void)openNoteCreator:(id)sender { 54 | NoteCreatorController * noteVC = [[NoteCreatorController alloc] init]; 55 | noteVC.notesControllerRef = self; 56 | [self.navigationController presentViewController:noteVC animated:YES completion:nil]; 57 | } 58 | 59 | 60 | - (void)didReceiveMemoryWarning { 61 | [super didReceiveMemoryWarning]; 62 | // Dispose of any resources that can be recreated. 63 | } 64 | 65 | -(void)addNewNote:(NSDictionary*)note { 66 | 67 | // add the new note to the top of our notes array 68 | [notes insertObject:note atIndex:0]; 69 | 70 | [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationRight]; 71 | 72 | } 73 | 74 | -(void)updateNote:(NSDictionary *)note { 75 | 76 | NSInteger foundIndex = -1; 77 | 78 | // find the note we just updated 79 | for (NSInteger i=0; i 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IOS/NoteApp/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /IOS/NoteApp/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /IOS/NoteApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NoteApp 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /IOS/NoteAppTests/NoteAppTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ideo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /IOS/NoteAppTests/NoteAppTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NoteAppTests.m 3 | // NoteAppTests 4 | // 5 | // Created by Todd Vanderlin on 6/4/14. 6 | // Copyright (c) 2014 IDEO. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NoteAppTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation NoteAppTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /IOS/NoteAppTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel & IOS 2 | We are going to build an app that will read and write to a Laravel API. 3 | 4 | # Create App 5 | 6 | Create a new Laravel app called noteApp. 7 | `composer create-project laravel/laravel noteApp --prefer-dist` 8 | 9 | Add the [Way Generators](https://github.com/vanderlin/LaravelTutorial/blob/master/readme.md#add-ways-generators) 10 | 11 | Update composer. 12 | `composer update` 13 | 14 | Turn on MAMP and test the site. 15 | 16 | # Setup Database 17 | open `/app/config/database.php` and set you mysql credentials. We are using MAMP so just use the defaults. [Create](https://github.com/vanderlin/LaravelTutorial/blob/master/readme.md#mamp-database) or use an existing database locally. 18 | > Note: If you are using a existing database its good practice to set a prefix in the `database.php`. 19 | 20 | You should have something like this. 21 | ``` 22 | 'mysql' => array( 23 | 'driver' => 'mysql', 24 | 'host' => 'localhost', 25 | 'database' => 'app', 26 | 'username' => 'root', 27 | 'password' => 'root', 28 | 'charset' => 'utf8', 29 | 'collation' => 'utf8_unicode_ci', 30 | 'prefix' => 'notes_', 31 | ), 32 | ``` 33 | 34 | # Build a Resource 35 | We are going to create an app that creates notes, so we want to create a new resource call `note`. 36 | 37 | Run. 38 | `php artisan generate:resource note --fields="body:text"` 39 | 40 | Open `app/routes.php` and a the new resource. 41 | `Route::Resource('notes', 'NotesController');` 42 | 43 | Test your new routes. In terminal type 44 | `php artisan routes` 45 | Your should see all the new verbs for creating/updating/deleting `notes`. 46 | 47 | Open `app/controllers/notesController.php` and the the functionality for creating updating and deleting notes. 48 | 49 | Your file should look like this. 50 | ``` 51 | Note::all()]); 58 | } 59 | 60 | // POST 61 | public function store() { 62 | $note = new Note(); 63 | $note->body = Input::get('body', 'empty note'); 64 | $note->save(); 65 | 66 | return Response::json($note); 67 | } 68 | 69 | // GET 70 | public function show($id) { 71 | $note = Note::find($id); 72 | return $note; 73 | } 74 | 75 | // PUT 76 | public function update($id) { 77 | $note = Note::find($id); 78 | if(Input::has('body')) { 79 | $note->body = Input::get('body', 'empty note'); 80 | $note->save(); 81 | return Response::json(['note'=>$note, 'message'=>'Note Updated']); 82 | } 83 | return Response::json(['note'=>$note, 'message'=>'No Body Sent']); 84 | } 85 | 86 | // DELETE 87 | public function destroy($id) { 88 | $note = Note::find($id); 89 | $note->delete(); 90 | return Response::json($note); 91 | } 92 | 93 | } 94 | ``` 95 | 96 | > **Note:** Most browsers/clients do not understand the PUT/UPDATE/DELETE methods. Laravel will accept a parameter named`_method` and interrupt this with the correct function to call. i.e `_method="PUT"`. 97 | 98 | # Test the API. 99 | - In [Chrome](https://www.google.com/intl/en-US/chrome/browser/) get the app called [PostMan](https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en) this is a nice little REST app for Chrome that allows you to test all the verbs for you API. 100 | 101 | Looking at your routes `php artisan routes` you can see how to all the URIs. 102 | 103 | **POST** a new `Note`. Add the key `body` and value `my new note`. 104 | http://laraveldemo:8888/notes 105 | 106 | **GET** all the `Notes`. 107 | http://localhost:8888/notes 108 | 109 | **DELETE** a `Note`. 110 | http://localhost:8888/notes/1 111 | 112 | # IOS 113 | Open XCode and create a new IOS project and select *Single View Application*. Name is NoteApp, select iPhone and save. 114 | 115 | ### Setup the Main.storyboard 116 | Delete everything in the `Main.storyboard`. Select the file and hit *(⌘+a) then (delete)* 117 | Delete the `ViewController.h` and `ViewController.m` files. 118 | 119 | ### Create NotesController 120 | File new. *(⌘+n)* 121 | Cocoa Touch -> Objective-C class 122 | Click Next 123 | Class: NotesController 124 | Subclass of: UITableViewController 125 | Click Next 126 | Create 127 | 128 | Click on the `Main.storyboard` and drag a new `Table View Controller` to the stage. With the Controller selected third button at the top of the inspector. Set the `Custom Class` to `NotesController`. Now in the top menu click *Editor -> Embed In -> Navigation Controller* 129 | 130 | Hit *(⌘+r)* and test the app. Everything should be connected and you should see a TableViewController in the simulator. 131 | 132 | ### Load the data from the server 133 | We are going to write all the loading functions in the `AppDelegate` this is good practice so that we can access these functions throughout the app. 134 | 135 | In the `AppDelegate.h` add `#define BASE_URL @"http://localhost:8888"` this will save us from having to type this a bunch and easy to set for production. 136 | 137 | **Singleton AppDelegate** 138 | This is a nice helper function to get the `AppDelegate` instance. Create this static method. 139 | 140 | **AppDelegate.h** 141 | `+(AppDelegate*)getInstance;` 142 | 143 | **Load Notes** 144 | ``` 145 | +(AppDelegate*)getInstance { 146 | return (AppDelegate*)[[UIApplication sharedApplication] delegate]; 147 | } 148 | ``` 149 | 150 | We can now call this simply by typing `[AppDelegate getInstance]` 151 | 152 | Lets make a function that will load any url with a http method. We also want to have a callback for when the data is done loading. We are going to use a `Block`. 153 | 154 | in your `AppDelegate.h` create a `typedef` of the `Block`. 155 | `typedef void(^RequestBlock)(NSDictionary*data);` 156 | 157 | This function can take a url that we want to load, params saved in a dictionary as key value pairs and a callback function. Add this to `AppDelegate.h` 158 | `-(void)makeRequest:(NSString*)urlString method:(NSString*)method params:(NSDictionary*)params onComplete:(RequestBlock)callback;` 159 | 160 | **AppDelegate.m** 161 | ``` 162 | -(void)makeRequest:(NSString*)urlString method:(NSString*)method params:(NSDictionary*)params onComplete:(RequestBlock)callback { 163 | 164 | // create the url 165 | NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", BASE_URL, urlString]]; 166 | NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL:url]; 167 | 168 | // set the method (GET/POST/PUT/UPDATE/DELETE) 169 | [request setHTTPMethod:method]; 170 | 171 | // if we have params pull out the key/value and add to header 172 | if(params != nil) { 173 | NSMutableString * body = [[NSMutableString alloc] init]; 174 | for (NSString * key in params.allKeys) { 175 | NSString * value = [params objectForKey:key]; 176 | [body appendFormat:@"%@=%@&", key, value]; 177 | } 178 | [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]]; 179 | } 180 | 181 | // submit the request 182 | [NSURLConnection sendAsynchronousRequest:request 183 | queue:[NSOperationQueue mainQueue] 184 | completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 185 | 186 | // do we have data? 187 | if(data && data.length > 0) { 188 | 189 | NSDictionary * json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; 190 | 191 | // if we have a block lets pass it 192 | if(callback) { 193 | callback(json); 194 | } 195 | 196 | } 197 | 198 | }]; 199 | 200 | } 201 | ``` 202 | 203 | Now lets test this function. In `AppDelegate.m` `didFinishLaunchingWithOptions` add the function to load all the notes. Note: If we have no params to pass just pass `nil`. 204 | 205 | ``` 206 | [self makeRequest:@"notes" params:nil method:@"GET" onComplete:^(NSDictionary *data) { 207 | NSLog(@"Json Loaded: %@", data); 208 | }]; 209 | ``` 210 | Run & Build. You will see output in the console of the a `NSDictionary` of all the notes. 211 | 212 | # Load Notes - NotesController 213 | 214 | First include the `AppDelegate` in the `NotesController` 215 | 216 | **NotesController.h** 217 | `#import "AppDelegate.h"` 218 | 219 | We want to have a `NSMutableArray` of all the notes. 220 | **NotesController.h** 221 | `@property (strong, nonatomic) NSMutableArray * notes;` 222 | **NotesController.m** 223 | `@synthesize notes;` 224 | 225 | Load the notes when the view loads. 226 | ``` 227 | - (void)viewDidLoad { 228 | [super viewDidLoad]; 229 | 230 | [[AppDelegate getInstance] makeRequest:@"notes" params:nil method:@"GET" onComplete:^(NSDictionary *data) { 231 | 232 | if([data objectForKey:@"notes"]) { 233 | notes = [NSMutableArray arrayWithArray:[data objectForKey:@"notes"]]; 234 | 235 | // now reload the tableview 236 | [self.tableView reloadData]; 237 | } 238 | 239 | }]; 240 | } 241 | ``` 242 | 243 | **Setup The TableView** 244 | Now that we have the data loaded we can set the sections and number of rows. 245 | 246 | ``` 247 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 248 | return notes ? 1 : 0; // safe way to not load rows if notes is nil 249 | } 250 | 251 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 252 | return notes.count; 253 | } 254 | ``` 255 | 256 | Setup the cell. 257 | ``` 258 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 259 | 260 | static NSString * cellID = @"NOTES_CELL"; 261 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; 262 | 263 | if(cell == nil) { 264 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID]; 265 | } 266 | 267 | // get the note 268 | NSDictionary * note = [notes objectAtIndex:indexPath.row]; 269 | 270 | // create a date formatter so we can display the date 271 | NSDateFormatter * df = [[NSDateFormatter alloc] init]; 272 | [df setDateFormat:@"yyyy-MM-dd H:mm:ss"]; 273 | 274 | // make a date object from the timestamp 275 | NSDate * date = [df dateFromString:[note objectForKey:@"created_at"]]; 276 | 277 | // change the format weekday/month/day/year 278 | [df setDateFormat:@"EE MMM d yyyy"]; 279 | NSString * dateStr = [df stringFromDate:date]; 280 | 281 | // change the format hour:min 282 | [df setDateFormat:@"h:mm a"]; 283 | NSString * timeStr = [df stringFromDate:date]; 284 | 285 | // update the cell 286 | cell.textLabel.text = dateStr; 287 | cell.detailTextLabel.text = timeStr; 288 | 289 | 290 | return cell; 291 | } 292 | ``` 293 | 294 | At this point we are loading the `Notes` and able to display them in our tableview -Yeah! Now we need to make some notes. 295 | 296 | # Create Notes 297 | Lets add right bar button item that will launch a note creator view. 298 | 299 | **Add the bar button** 300 | In the `viewDidLoad` add the following code. 301 | ``` 302 | UIBarButtonItem * noteButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose 303 | target:self 304 | action:@selector(openNoteCreator:)]; 305 | self.navigationItem.rightBarButtonItem = noteButton; 306 | ``` 307 | 308 | And add this function 309 | ``` 310 | -(void)openNoteCreator:(id)sender { 311 | 312 | } 313 | ``` 314 | 315 | Run the app and you will see a compose icon in the top right. Let create the `NoteCreatorController`. Like before create a new class that subclasses a `UIViewController`. 316 | 317 | Connect the `NoteCreatorController` in the `NotesController`. 318 | 319 | Import the class 320 | ** NotesController.m** 321 | `#import "NoteCreatorController.h"` 322 | 323 | Update the `openNoteCreator` method. 324 | ``` 325 | -(void)openNoteCreator:(id)sender { 326 | NoteCreatorController * noteVC = [[NoteCreatorController alloc] init]; 327 | [self.navigationController presentViewController:noteVC animated:YES completion:nil]; 328 | } 329 | ``` 330 | 331 | ### Build the note creator 332 | We need a few things in the class. Buttons to close the modal and save the note as well a textview to write the note. 333 | 334 | Create a close function. 335 | ``` 336 | -(void)close { 337 | [self dismissViewControllerAnimated:YES completion:nil]; 338 | } 339 | ``` 340 | 341 | Create a save function *(we will fill this in later)* 342 | ``` 343 | -(void)save { 344 | 345 | } 346 | ``` 347 | 348 | Create button to call these two methods. You will create them in the `viewDidLoad` method. 349 | 350 | ``` 351 | - (void)viewDidLoad { 352 | [super viewDidLoad]; 353 | 354 | 355 | self.view.backgroundColor = [UIColor whiteColor]; 356 | 357 | UIToolbar * toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)]; 358 | 359 | 360 | // close button 361 | UIBarButtonItem * closeBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(close)]; 362 | 363 | // spacer 364 | UIBarButtonItem * spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 365 | 366 | // save button 367 | UIBarButtonItem * saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; 368 | 369 | // set the items for toolbar 370 | toolbar.items = @[closeBtn, spacer, saveBtn]; 371 | 372 | [self.view addSubview:toolbar]; 373 | 374 | } 375 | ``` 376 | 377 | **The TextView** 378 | We need a `UITextView` and have this controller respond to the `UITextView` protocol. 379 | 380 | **NoteCreatorController.h** 381 | ``` 382 | @interface NoteCreatorController : UIViewController 383 | 384 | @property (strong, nonatomic) UITextView * textView; 385 | 386 | @end 387 | ``` 388 | 389 | **NoteCreatorController.m** 390 | `@synthesize noteTextView;` 391 | Add this to the `viewDidLoad` method. 392 | ``` 393 | noteTextView = [[UITextView alloc] initWithFrame:CGRectMake(20, 70, self.view.frame.size.width-40, 170)]; 394 | noteTextView.backgroundColor = [UIColor lightGrayColor]; 395 | noteTextView.delegate = self; 396 | [self.view addSubview:noteTextView]; 397 | 398 | // auto launch the keyboard 399 | [noteTextView becomeFirstResponder]; 400 | ``` 401 | 402 | **Save Data** 403 | Lets fill out the `save` method. First import the `AppDelegate` in you `NoteCreatorController.m`. We want to dismiss the keyboard, grab the text from the `UITextView` and save it with our `makeRequest` method. 404 | 405 | Save the data: 406 | ``` 407 | -(void)save { 408 | 409 | // if the keyboard is up dismiss it 410 | if([noteTextView isFirstResponder]) { 411 | [noteTextView resignFirstResponder]; 412 | } 413 | 414 | NSString * body = noteTextView.text; 415 | 416 | // save this data 417 | [[AppDelegate getInstance] makeRequest:@"notes" 418 | method:@"POST" 419 | params:@{@"body": body} 420 | onComplete:^(NSDictionary *data) { 421 | 422 | // we need to dismiss the view controller 423 | // and update the tableview in NotesController 424 | 425 | }]; 426 | 427 | } 428 | ``` 429 | 430 | **Close the Notes Creator & Update TableView** 431 | In order to update the `NotesController` we need a reference to the instance of this controller. Lets create a function in `NotesController ` that will update the `UITableView` with a new note. 432 | 433 | In `NotesController.h` add: 434 | `-(void)addNewNote:(NSDictionary*)note;` 435 | 436 | In `NotesController.m` add: 437 | ``` 438 | code 439 | ``` 440 | 441 | In the `NoteCreatorController` we need a `weak` reference to the `NotesController`. 442 | 443 | In `NoteCreatorController.h` add: 444 | `@property (weak, nonatomic) NotesController * notesControllerRef;` 445 | 446 | In `NoteCreatorController.m` add: 447 | `@synthesize notesControllerRef;` 448 | 449 | In the `openNoteCreator` method add the reference. 450 | ``` 451 | -(void)openNoteCreator:(id)sender { 452 | NoteCreatorController * noteVC = [[NoteCreatorController alloc] init]; 453 | noteVC.notesControllerRef = self; 454 | [self.navigationController presentViewController:noteVC animated:YES completion:nil]; 455 | } 456 | ``` 457 | 458 | Now when we close the `NoteCreatorController` we can call the `addNewNote` when the animation is complete. Our `save` method now looks like this. 459 | ``` 460 | -(void)save { 461 | 462 | // if the keyboard is up dismiss it 463 | if([noteTextView isFirstResponder]) { 464 | [noteTextView resignFirstResponder]; 465 | } 466 | 467 | NSString * body = noteTextView.text; 468 | 469 | // save this data 470 | [[AppDelegate getInstance] makeRequest:@"notes" 471 | method:@"POST" 472 | params:@{@"body": body} 473 | onComplete:^(NSDictionary *data) { 474 | 475 | // we need to dismiss the view controller 476 | // and update the tableview in NotesController 477 | [self dismissViewControllerAnimated:YES completion:^{ 478 | [notesControllerRef addNewNote:[data objectForKey:@"note"]]; 479 | }]; 480 | 481 | }]; 482 | 483 | } 484 | ``` 485 | 486 | Looks good we are now adding a new cell and saving our new note to the database. 487 | 488 | # Edit/Delete a note 489 | Lets add a way to edit and delete a note. First a `weak` reference of a `NSDictionary` note in the `NoteCreatorController`. We do this so that when we tap on a `TableViewCell` we pass the note and can update the text in the `NoteCreatorController`. 490 | 491 | In `NoteCreatorController.h` 492 | @property (weak, nonatomic) NSDictionary * noteRef; 493 | In `NoteCreatorController.m` 494 | `@synthesize noteRef;` 495 | 496 | We want to modify the `ViewDidLoad` to check if we have a `noteRef`. If we have a note we set the text else we show the keyboard. 497 | ``` 498 | if(noteRef == nil) { 499 | [noteTextView becomeFirstResponder]; 500 | } 501 | else { 502 | noteTextView.text = noteTextView.text; 503 | } 504 | ``` 505 | 506 | Now in our `NotesController` we add the method. 507 | ``` 508 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 509 | 510 | NSDictionary * note = [notes objectAtIndex:indexPath.row]; 511 | 512 | NoteCreatorController * noteVC = [[NoteCreatorController alloc] init]; 513 | noteVC.notesControllerRef = self; 514 | noteVC.noteRef = note; 515 | 516 | [self.navigationController presentViewController:noteVC animated:YES completion:nil]; 517 | 518 | } 519 | ``` 520 | 521 | Create a update Cell method in `NoteController`. 522 | ``` 523 | -(void)updateNote:(NSDictionary *)note { 524 | 525 | NSInteger foundIndex = -1; 526 | 527 | // find the note we just updated 528 | for (NSInteger i=0; i **Note:** Most browsers/clients do not understand the PUT/UPDATE/DELETE methods. Laravel will accept a parameter named`_method` and interrupt this with the correct function to call. i.e `_method="PUT"`. 601 | 602 | Awesome, we are now updating our Notes, time to delete a note. Lets add a delete button to our toolbar in the `NotesCreatorController` and create a `deleteNote` method. 603 | 604 | In `NotesCreatorController.m` 605 | ` UIBarButtonItem * deleteBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(deleteNote)];` 606 | 607 | We also need a `removeNote` in our `NotesController`. Create this function. 608 | 609 | ** NotesController.h**` 610 | `-(void)removeNote:(NSDictionary*)note;` 611 | 612 | ** NotesController.m**` 613 | ``` 614 | -(void)removeNote:(NSDictionary *)note { 615 | 616 | NSInteger foundIndex = -1; 617 | 618 | // find the note we just updated 619 | for (NSInteger i=0; i true, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => 'http://localhost', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'en', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Fallback Locale 60 | |-------------------------------------------------------------------------- 61 | | 62 | | The fallback locale determines the locale to use when the current one 63 | | is not available. You may change the value to correspond to any of 64 | | the language folders that are provided through your application. 65 | | 66 | */ 67 | 68 | 'fallback_locale' => 'en', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Encryption Key 73 | |-------------------------------------------------------------------------- 74 | | 75 | | This key is used by the Illuminate encrypter service and should be set 76 | | to a random, 32 character string, otherwise these encrypted strings 77 | | will not be safe. Please do this before deploying an application! 78 | | 79 | */ 80 | 81 | 'key' => 'ywQKHAvFDaygmcPW3t9UC8lLyBQNjACU', 82 | 83 | 'cipher' => MCRYPT_RIJNDAEL_128, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Autoloaded Service Providers 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The service providers listed here will be automatically loaded on the 91 | | request to your application. Feel free to add your own services to 92 | | this array to grant expanded functionality to your applications. 93 | | 94 | */ 95 | 96 | 'providers' => array( 97 | 'Way\Generators\GeneratorsServiceProvider', 98 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 99 | 'Illuminate\Auth\AuthServiceProvider', 100 | 'Illuminate\Cache\CacheServiceProvider', 101 | 'Illuminate\Session\CommandsServiceProvider', 102 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 103 | 'Illuminate\Routing\ControllerServiceProvider', 104 | 'Illuminate\Cookie\CookieServiceProvider', 105 | 'Illuminate\Database\DatabaseServiceProvider', 106 | 'Illuminate\Encryption\EncryptionServiceProvider', 107 | 'Illuminate\Filesystem\FilesystemServiceProvider', 108 | 'Illuminate\Hashing\HashServiceProvider', 109 | 'Illuminate\Html\HtmlServiceProvider', 110 | 'Illuminate\Log\LogServiceProvider', 111 | 'Illuminate\Mail\MailServiceProvider', 112 | 'Illuminate\Database\MigrationServiceProvider', 113 | 'Illuminate\Pagination\PaginationServiceProvider', 114 | 'Illuminate\Queue\QueueServiceProvider', 115 | 'Illuminate\Redis\RedisServiceProvider', 116 | 'Illuminate\Remote\RemoteServiceProvider', 117 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 118 | 'Illuminate\Database\SeedServiceProvider', 119 | 'Illuminate\Session\SessionServiceProvider', 120 | 'Illuminate\Translation\TranslationServiceProvider', 121 | 'Illuminate\Validation\ValidationServiceProvider', 122 | 'Illuminate\View\ViewServiceProvider', 123 | 'Illuminate\Workbench\WorkbenchServiceProvider', 124 | 125 | ), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Service Provider Manifest 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service provider manifest is used by Laravel to lazy load service 133 | | providers which are not needed for each request, as well to keep a 134 | | list of all of the services. Here, you may set its storage spot. 135 | | 136 | */ 137 | 138 | 'manifest' => storage_path().'/meta', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Class Aliases 143 | |-------------------------------------------------------------------------- 144 | | 145 | | This array of class aliases will be registered when this application 146 | | is started. However, feel free to register as many as you wish as 147 | | the aliases are "lazy" loaded so they don't hinder performance. 148 | | 149 | */ 150 | 151 | 'aliases' => array( 152 | 153 | 'App' => 'Illuminate\Support\Facades\App', 154 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 155 | 'Auth' => 'Illuminate\Support\Facades\Auth', 156 | 'Blade' => 'Illuminate\Support\Facades\Blade', 157 | 'Cache' => 'Illuminate\Support\Facades\Cache', 158 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 159 | 'Config' => 'Illuminate\Support\Facades\Config', 160 | 'Controller' => 'Illuminate\Routing\Controller', 161 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 162 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 163 | 'DB' => 'Illuminate\Support\Facades\DB', 164 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 165 | 'Event' => 'Illuminate\Support\Facades\Event', 166 | 'File' => 'Illuminate\Support\Facades\File', 167 | 'Form' => 'Illuminate\Support\Facades\Form', 168 | 'Hash' => 'Illuminate\Support\Facades\Hash', 169 | 'HTML' => 'Illuminate\Support\Facades\HTML', 170 | 'Input' => 'Illuminate\Support\Facades\Input', 171 | 'Lang' => 'Illuminate\Support\Facades\Lang', 172 | 'Log' => 'Illuminate\Support\Facades\Log', 173 | 'Mail' => 'Illuminate\Support\Facades\Mail', 174 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 175 | 'Password' => 'Illuminate\Support\Facades\Password', 176 | 'Queue' => 'Illuminate\Support\Facades\Queue', 177 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 178 | 'Redis' => 'Illuminate\Support\Facades\Redis', 179 | 'Request' => 'Illuminate\Support\Facades\Request', 180 | 'Response' => 'Illuminate\Support\Facades\Response', 181 | 'Route' => 'Illuminate\Support\Facades\Route', 182 | 'Schema' => 'Illuminate\Support\Facades\Schema', 183 | 'Seeder' => 'Illuminate\Database\Seeder', 184 | 'Session' => 'Illuminate\Support\Facades\Session', 185 | 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', 186 | 'SSH' => 'Illuminate\Support\Facades\SSH', 187 | 'Str' => 'Illuminate\Support\Str', 188 | 'URL' => 'Illuminate\Support\Facades\URL', 189 | 'Validator' => 'Illuminate\Support\Facades\Validator', 190 | 'View' => 'Illuminate\Support\Facades\View', 191 | 192 | ), 193 | 194 | ); 195 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'emails.auth.reminder', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); 72 | -------------------------------------------------------------------------------- /app/config/cache.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'app', 59 | 'username' => 'root', 60 | 'password' => 'root', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => 'notes_', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'forge', 70 | 'username' => 'forge', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk haven't actually been run in the database. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => false, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/local/app.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | ); 19 | -------------------------------------------------------------------------------- /app/config/local/database.php: -------------------------------------------------------------------------------- 1 | array( 22 | 23 | 'mysql' => array( 24 | 'driver' => 'mysql', 25 | 'host' => 'localhost', 26 | 'database' => 'homestead', 27 | 'username' => 'homestead', 28 | 'password' => 'secret', 29 | 'charset' => 'utf8', 30 | 'collation' => 'utf8_unicode_ci', 31 | 'prefix' => '', 32 | ), 33 | 34 | 'pgsql' => array( 35 | 'driver' => 'pgsql', 36 | 'host' => 'localhost', 37 | 'database' => 'homestead', 38 | 'username' => 'homestead', 39 | 'password' => 'secret', 40 | 'charset' => 'utf8', 41 | 'prefix' => '', 42 | 'schema' => 'public', 43 | ), 44 | 45 | ), 46 | 47 | ); 48 | -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | 'ttr' => 60, 42 | ), 43 | 44 | 'sqs' => array( 45 | 'driver' => 'sqs', 46 | 'key' => 'your-public-key', 47 | 'secret' => 'your-secret-key', 48 | 'queue' => 'your-queue-url', 49 | 'region' => 'us-east-1', 50 | ), 51 | 52 | 'iron' => array( 53 | 'driver' => 'iron', 54 | 'host' => 'mq-aws-us-east-1.iron.io', 55 | 'token' => 'your-token', 56 | 'project' => 'your-project-id', 57 | 'queue' => 'your-queue-name', 58 | 'encrypt' => true, 59 | ), 60 | 61 | 'redis' => array( 62 | 'driver' => 'redis', 63 | 'queue' => 'default', 64 | ), 65 | 66 | ), 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Failed Queue Jobs 71 | |-------------------------------------------------------------------------- 72 | | 73 | | These options configure the behavior of failed queue job logging so you 74 | | can control which database and table are used to store the jobs that 75 | | have failed. You may change them to any database / table you wish. 76 | | 77 | */ 78 | 79 | 'failed' => array( 80 | 81 | 'database' => 'mysql', 'table' => 'failed_jobs', 82 | 83 | ), 84 | 85 | ); 86 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); 60 | -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | array( 18 | 'domain' => '', 19 | 'secret' => '', 20 | ), 21 | 22 | 'mandrill' => array( 23 | 'secret' => '', 24 | ), 25 | 26 | 'stripe' => array( 27 | 'model' => 'User', 28 | 'secret' => '', 29 | ), 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'file', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session File Location 39 | |-------------------------------------------------------------------------- 40 | | 41 | | When using the native session driver, we need a location where session 42 | | files may be stored. A default has been set for you but a different 43 | | location may be specified. This is only needed for file sessions. 44 | | 45 | */ 46 | 47 | 'files' => storage_path().'/sessions', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session Database Connection 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the "database" or "redis" session drivers, you may specify a 55 | | connection that should be used to manage these sessions. This should 56 | | correspond to a connection in your database configuration options. 57 | | 58 | */ 59 | 60 | 'connection' => null, 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Table 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" session driver, you may specify the table we 68 | | should use to manage the sessions. Of course, a sensible default is 69 | | provided for you; however, you are free to change this as needed. 70 | | 71 | */ 72 | 73 | 'table' => 'sessions', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Sweeping Lottery 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some session drivers must manually sweep their storage location to get 81 | | rid of old sessions from storage. Here are the chances that it will 82 | | happen on a given request. By default, the odds are 2 out of 100. 83 | | 84 | */ 85 | 86 | 'lottery' => array(2, 100), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cookie Name 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Here you may change the name of the cookie used to identify a session 94 | | instance by ID. The name specified here will get used every time a 95 | | new session cookie is created by the framework for every driver. 96 | | 97 | */ 98 | 99 | 'cookie' => 'laravel_session', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Path 104 | |-------------------------------------------------------------------------- 105 | | 106 | | The session cookie path determines the path for which the cookie will 107 | | be regarded as available. Typically, this will be the root path of 108 | | your application but you are free to change this when necessary. 109 | | 110 | */ 111 | 112 | 'path' => '/', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Domain 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the domain of the cookie used to identify a session 120 | | in your application. This will determine which domains the cookie is 121 | | available to in your application. A sensible default has been set. 122 | | 123 | */ 124 | 125 | 'domain' => null, 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | HTTPS Only Cookies 130 | |-------------------------------------------------------------------------- 131 | | 132 | | By setting this option to true, session cookies will only be sent back 133 | | to the server if the browser has a HTTPS connection. This will keep 134 | | the cookie from being sent to you if it can not be done securely. 135 | | 136 | */ 137 | 138 | 'secure' => false, 139 | 140 | ); 141 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | get(); 8 | return Response::json(['notes'=>$notes]); 9 | } 10 | 11 | // POST 12 | public function store() { 13 | $note = new Note(); 14 | $note->body = Input::get('body', 'empty note'); 15 | $note->save(); 16 | 17 | return Response::json(['note'=>$note, 'message'=>'Note Created']); 18 | } 19 | 20 | // GET 21 | public function show($id) { 22 | $note = Note::find($id); 23 | return $note; 24 | } 25 | 26 | // PUT 27 | public function update($id) { 28 | $note = Note::find($id); 29 | if(Input::has('body')) { 30 | $note->body = Input::get('body', 'empty note'); 31 | $note->save(); 32 | return Response::json(['note'=>$note, 'message'=>'Note Updated']); 33 | } 34 | return Response::json(['note'=>$note, 'message'=>'No Body Sent']); 35 | } 36 | 37 | // DELETE 38 | public function destroy($id) { 39 | $note = Note::find($id); 40 | $note->delete(); 41 | return Response::json(['note'=>$note, 'message'=>'Note Deleted']); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/app/database/migrations/.gitkeep -------------------------------------------------------------------------------- /app/database/migrations/2014_06_04_143133_create_notes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->text('body'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('notes'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/app/database/production.sqlite -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/app/database/seeds/.gitkeep -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/database/seeds/NotesTableSeeder.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => array( 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ), 30 | "confirmed" => "The :attribute confirmation does not match.", 31 | "date" => "The :attribute is not a valid date.", 32 | "date_format" => "The :attribute does not match the format :format.", 33 | "different" => "The :attribute and :other must be different.", 34 | "digits" => "The :attribute must be :digits digits.", 35 | "digits_between" => "The :attribute must be between :min and :max digits.", 36 | "email" => "The :attribute must be a valid email address.", 37 | "exists" => "The selected :attribute is invalid.", 38 | "image" => "The :attribute must be an image.", 39 | "in" => "The selected :attribute is invalid.", 40 | "integer" => "The :attribute must be an integer.", 41 | "ip" => "The :attribute must be a valid IP address.", 42 | "max" => array( 43 | "numeric" => "The :attribute may not be greater than :max.", 44 | "file" => "The :attribute may not be greater than :max kilobytes.", 45 | "string" => "The :attribute may not be greater than :max characters.", 46 | "array" => "The :attribute may not have more than :max items.", 47 | ), 48 | "mimes" => "The :attribute must be a file of type: :values.", 49 | "min" => array( 50 | "numeric" => "The :attribute must be at least :min.", 51 | "file" => "The :attribute must be at least :min kilobytes.", 52 | "string" => "The :attribute must be at least :min characters.", 53 | "array" => "The :attribute must have at least :min items.", 54 | ), 55 | "not_in" => "The selected :attribute is invalid.", 56 | "numeric" => "The :attribute must be a number.", 57 | "regex" => "The :attribute format is invalid.", 58 | "required" => "The :attribute field is required.", 59 | "required_if" => "The :attribute field is required when :other is :value.", 60 | "required_with" => "The :attribute field is required when :values is present.", 61 | "required_with_all" => "The :attribute field is required when :values is present.", 62 | "required_without" => "The :attribute field is required when :values is not present.", 63 | "required_without_all" => "The :attribute field is required when none of :values are present.", 64 | "same" => "The :attribute and :other must match.", 65 | "size" => array( 66 | "numeric" => "The :attribute must be :size.", 67 | "file" => "The :attribute must be :size kilobytes.", 68 | "string" => "The :attribute must be :size characters.", 69 | "array" => "The :attribute must contain :size items.", 70 | ), 71 | "unique" => "The :attribute has already been taken.", 72 | "url" => "The :attribute format is invalid.", 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Custom Validation Language Lines 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Here you may specify custom validation messages for attributes using the 80 | | convention "attribute.rule" to name the lines. This makes it quick to 81 | | specify a specific custom language line for a given attribute rule. 82 | | 83 | */ 84 | 85 | 'custom' => array( 86 | 'attribute-name' => array( 87 | 'rule-name' => 'custom-message', 88 | ), 89 | ), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Custom Validation Attributes 94 | |-------------------------------------------------------------------------- 95 | | 96 | | The following language lines are used to swap attribute place-holders 97 | | with something more reader friendly such as E-Mail Address instead 98 | | of "email". This simply helps us make messages a little cleaner. 99 | | 100 | */ 101 | 102 | 'attributes' => array(), 103 | 104 | ); 105 | -------------------------------------------------------------------------------- /app/models/Note.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
11 | This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes. 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/hello.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Laravel PHP Framework 6 | 35 | 36 | 37 |
38 | Laravel PHP Framework 39 |

You have arrived.

40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /app/views/notes/create.blade.php: -------------------------------------------------------------------------------- 1 | /Users/tvanderlin/Desktop/laravel/noteApp/app/views/notes/create.blade.php -------------------------------------------------------------------------------- /app/views/notes/edit.blade.php: -------------------------------------------------------------------------------- 1 | /Users/tvanderlin/Desktop/laravel/noteApp/app/views/notes/edit.blade.php -------------------------------------------------------------------------------- /app/views/notes/index.blade.php: -------------------------------------------------------------------------------- 1 | /Users/tvanderlin/Desktop/laravel/noteApp/app/views/notes/index.blade.php -------------------------------------------------------------------------------- /app/views/notes/show.blade.php: -------------------------------------------------------------------------------- 1 | /Users/tvanderlin/Desktop/laravel/noteApp/app/views/notes/show.blade.php -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setRequestForConsoleEnvironment(); 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); 75 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('homestead'), 30 | 31 | )); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Bind Paths 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here we are binding the paths configured in paths.php to the app. You 39 | | should not be changing these here. If you need to change these you 40 | | may do so within the paths.php file and they will be bound here. 41 | | 42 | */ 43 | 44 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Load The Application 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here we will load this Illuminate application. We will keep this in a 52 | | separate location so we can isolate the creation of an application 53 | | from the actual running of the application with a given request. 54 | | 55 | */ 56 | 57 | $framework = $app['path.base']. 58 | '/vendor/laravel/framework/src'; 59 | 60 | require $framework.'/Illuminate/Foundation/start.php'; 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Return The Application 65 | |-------------------------------------------------------------------------- 66 | | 67 | | This script returns the application instance. The instance is given to 68 | | the calling script so we can separate the building of the instances 69 | | from the actual running of the application and sending responses. 70 | | 71 | */ 72 | 73 | return $app; 74 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.2.*", 8 | "way/generators": "dev-master" 9 | }, 10 | "autoload": { 11 | "classmap": [ 12 | "app/commands", 13 | "app/controllers", 14 | "app/models", 15 | "app/database/migrations", 16 | "app/database/seeds", 17 | "app/tests/TestCase.php" 18 | ] 19 | }, 20 | "scripts": { 21 | "post-install-cmd": [ 22 | "php artisan clear-compiled", 23 | "php artisan optimize" 24 | ], 25 | "post-update-cmd": [ 26 | "php artisan clear-compiled", 27 | "php artisan optimize" 28 | ], 29 | "post-create-project-cmd": [ 30 | "php artisan key:generate" 31 | ] 32 | }, 33 | "config": { 34 | "preferred-install": "dist" 35 | }, 36 | "minimum-stability": "stable" 37 | } 38 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanderlin/Laravel-IOSTutorial/e5926cb2a35d97d9fd00c26bf1a98da84bed8315/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 |