Skip to content

Commit

Permalink
Changes in appearance of the main page
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzesiek committed Apr 12, 2017
1 parent 9fbe44a commit d80bfad
Show file tree
Hide file tree
Showing 37 changed files with 1,657 additions and 770 deletions.
17 changes: 17 additions & 0 deletions app/Http/Controllers/CategoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Controllers;

use App\Category;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
public function showAllProducts(Category $category){

$products = $category->products;

return view('category_products', compact('category', 'products'));

}
}
10 changes: 10 additions & 0 deletions app/Http/Controllers/ProductController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProductController extends Controller
{
//
}
22 changes: 22 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Controllers;

use App\User;
use Illuminate\Http\Request;

class UserController extends Controller
{
public function index(){

$users = User::all();

return view('users', compact('users'));
}

public function showItemsInCart(User $user){

$items = $user->cart->items;
return view('cart', compact('items'));
}
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "v2.3.2",
"barryvdh/laravel-ide-helper": "v2.3.2",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "~5.0"
Expand Down
Loading

0 comments on commit d80bfad

Please sign in to comment.