You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Sign up](https://stripe.com/) or log into your [dashboard](https://manage.stripe.com)
@@ -423,22 +412,6 @@ how a particular functionality works. Maybe you are just curious about
423
412
how it works, or maybe you are lost and confused while reading the code,
424
413
I hope it provides some guidance to you.
425
414
426
-
###Custom HTML and CSS Design 101
427
-
428
-
[HTML5 UP](http://html5up.net/) has many beautiful templates that you can download for free.
429
-
430
-
When you download the ZIP file, it will come with *index.html*, *images*, *css* and *js* folders. So, how do you
431
-
integrate it with Hackathon Starter? Hackathon Starter uses Bootstrap CSS framework, but these templates do not.
432
-
Trying to use both CSS files at the same time will likely result in undesired effects.
433
-
434
-
**Note:** Using the custom templates approach, you should understand that you cannot reuse any of the views I have created: layout, home page, api browser, login, signup, account management, contact. Those views were built using Bootstrap grid and styles. You will have to manually update the grid using a different syntax provided in the template. **Having said that, you can mix and match if you want to do so: Use Bootstrap for main app interface, and a custom template for a landing page.**
435
-
436
-
Let's start from the beginning. For this example I will use [Escape Velocity](http://html5up.net/escape-velocity/) template:
**Note:** For the sake of simplicity I will only consider `index.html`, and skip `left-sidebar.html`,
440
-
`no-sidebar.html`, `right-sidebar.html`.
441
-
442
415
<hr>
443
416
444
417
### How do flash messages work in this project?
@@ -472,19 +445,19 @@ checks if you are authenticated:
472
445
]);
473
446
```
474
447
475
-
If you are authenticated, you let this visitor pass through your "door" by calling `return next();` in the auth middleware and if you are authenticated, you will be redirected to *Account Management* page, otherwise you will be redirected to *Login* page.
448
+
If you are authenticated, you let this visitor pass through your "door" by calling `return $next($request);` in the auth middleware and if you are authenticated, you will be redirected to *Account Management* page, otherwise you will be redirected to *Login* page.
476
449
477
450
Here is a typical workflow for adding new routes to your application. Let's say we are building
478
451
a page that lists all books from database.
479
452
480
453
**Step 1.** Start by defining a route.
481
454
482
-
```js
455
+
```php
483
456
Route::get('/books', 'BookController@getBooks');
484
457
```
485
458
---
486
459
487
-
**Step 2.** Create a new schema and a model `Book.php` inside the *app* directory. You can simply run `php artisan make:model Book`
460
+
**Step 2.** Create a new model `Book.php` inside the *app* directory. You can simply run `php artisan make:model Book`
488
461
489
462
```php
490
463
@@ -498,13 +471,49 @@ class Book
498
471
* @var array
499
472
*/
500
473
protected $fillable = [
501
-
'name', 'author',
474
+
'name', 'isbn',
502
475
];
503
476
}
504
477
505
478
```
506
479
507
-
**Step 3.** Create a new controller file called `BookController` inside the *app/Http/Controllers* directory. You can simply run `php artisan make:controller BookController`
480
+
**Step 3.** Create a migration file like so: `php artisan make:migration create_books_table`
481
+
482
+
```php
483
+
484
+
use Illuminate\Database\Schema\Blueprint;
485
+
use Illuminate\Database\Migrations\Migration;
486
+
487
+
class CreateBooksTable extends Migration
488
+
{
489
+
/**
490
+
* Run the migrations.
491
+
*
492
+
* @return void
493
+
*/
494
+
public function up()
495
+
{
496
+
Schema::create('books', function (Blueprint $table) {
497
+
$table->increments('id');
498
+
$table->string('name');
499
+
$table->string('isbn');
500
+
$table->timestamps();
501
+
});
502
+
}
503
+
504
+
/**
505
+
* Reverse the migrations.
506
+
*
507
+
* @return void
508
+
*/
509
+
public function down()
510
+
{
511
+
Schema::drop('books');
512
+
}
513
+
}
514
+
```
515
+
516
+
**Step 4.** Create a new controller file called `BookController` inside the *app/Http/Controllers* directory. You can simply run `php artisan make:controller BookController`
508
517
509
518
```php
510
519
namespace App\Http\Controllers;
@@ -530,7 +539,7 @@ class BookController extends Controller
0 commit comments