Browse Source

helium merging changes

Helium 6 years ago
parent
commit
af6029083d
35 changed files with 1337 additions and 436 deletions
  1. 1 6
      .gitignore
  2. 54 0
      app/Http/Controllers/ProfileController.php
  3. 56 0
      app/Http/Controllers/RegisterProfileController.php
  4. 7 4
      app/Http/Controllers/UsersItemController.php
  5. 37 0
      app/Http/Requests/ProfileRequest.php
  6. 28 0
      app/Models/Profile.php
  7. 1 1
      composer.json
  8. 233 240
      composer.lock
  9. 1 1
      database/migrations/2018_04_15_165539_create_items_exchange_table.php
  10. 47 0
      database/migrations/2018_04_21_182224_create_profiles_table.php
  11. 7 0
      public/css/main.css
  12. 39 0
      public/css/navbar.css
  13. 3 3
      resources/lang/en/validation.php
  14. 2 2
      resources/views/auth/login.blade.php
  15. 1 1
      resources/views/auth/passwords/email.blade.php
  16. 1 1
      resources/views/auth/passwords/reset.blade.php
  17. 2 2
      resources/views/auth/register.blade.php
  18. 1 1
      resources/views/categories/index.blade.php
  19. 96 78
      resources/views/itemregister/item.blade.php
  20. 2 2
      resources/views/items/info_page.blade.php
  21. 1 1
      resources/views/items/registration.blade.php
  22. 16 12
      resources/views/layouts/app.blade.php
  23. 90 57
      resources/views/layouts/navbar.blade.php
  24. 4 5
      resources/views/templates/item_small_view.blade.php
  25. 1 1
      resources/views/templates/modal_form.blade.php
  26. 136 0
      resources/views/userprofile/index.blade.php
  27. 217 0
      resources/views/userprofile/profile.blade.php
  28. 82 0
      resources/views/userprofile/profile_form.blade.php
  29. 121 0
      resources/views/userprofile/templates.blade.php
  30. 1 1
      resources/views/welcome.blade.php
  31. 13 5
      routes/web.php
  32. 0 1
      storage/sphinx/.gitignore
  33. 11 11
      storage/sphinx/etc/sphinx-awlex.conf
  34. 0 0
      storage/sphinx/log/query.log
  35. 25 0
      storage/sphinx/log/searchd.log

+ 1 - 6
.gitignore

@@ -6,15 +6,10 @@
 /.idea
 /.vscode
 /.vagrant
-Homestead.json
-Homestead.yaml
-npm-debug.log
-yarn-error.log
 .env
 /.sketch
 /app/DBTableClassFactory
 /database/migrations/Temp
 resources/views/debug.blade.php
 /app/Http/Controllers/DebugController.php
-/storage/sphinx/data
-/storage/sphinx/log
+composer.lock

+ 54 - 0
app/Http/Controllers/ProfileController.php

@@ -0,0 +1,54 @@
+<?php
+
+
+namespace App\Http\Controllers;
+
+use App\Http\Controllers\Controller;
+use App\Models\Profile;
+use App\User;
+use Illuminate\Http\Request;
+use App\Models\Item;
+use App\Models\Picture;
+use Illuminate\Support\Facades\Auth;
+
+
+class ProfileController extends Controller
+{
+
+    public function index()
+    {
+
+        $contentContainer = '';
+
+        $profile = Profile::where('user_id', Auth::id())->first();
+        if ($profile) {
+            $contentContainer = (string)view('userprofile.profile_form', ['profile' => $profile]);
+        }
+
+        return view('userprofile.index', ["contentContainer" => $contentContainer]);
+    }
+
+
+    public function showAllItems(User $user = null)
+    {
+
+        $user = $user ?: Auth::user();
+
+        $userItemsList = Item::where('user_id', '=', $user->id)->get();
+        if (count($userItemsList) > 0) {
+            $userItemsList->load('picture');
+        }
+
+        return view('userprofile.index', ['itemsList' => $userItemsList]);
+
+    }
+
+    public function userProfileInfo()
+    {
+        $contentContainer = '';
+
+        $contentContainer = RegisterProfileController::createView();
+
+        return view('userprofile.index', ["contentContainer" => $contentContainer]);
+    }
+}

+ 56 - 0
app/Http/Controllers/RegisterProfileController.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Http\Requests\ProfileRequest;
+use App\Models\Profile;
+use App\User;
+use Illuminate\Http\Request;
+use App\Http\Controllers\Controller;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Input;
+
+
+class RegisterProfileController extends Controller
+{
+    public function create()
+    {
+        $profile = Profile::where('user_id', Auth::id())->first() ?? new Profile();
+        return view('userprofile.profile', ['profile' => $profile]);
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request $request
+     * @return \Illuminate\Http\Response
+     */
+
+    public function store(ProfileRequest $request)
+    {
+        $user = Auth::user();
+
+        if ($request->isMethod('POST')) {
+            $profile = Profile::where('user_id', Auth::id())->first();
+
+            if ($profile) {
+                $profile->fill($request->except('_token', 'submit'));
+                $profile->update();
+            }
+            if (!$profile) {
+                $profile = new Profile($request->all());
+                $profile->save();
+            }
+        }
+
+
+        return redirect()->route('home')->with(['message' => 'Профиль создан']);
+
+    }
+
+    public static function createView()
+    {
+        return self::create();
+    }
+
+}

+ 7 - 4
app/Http/Controllers/UsersItemController.php

@@ -23,10 +23,13 @@ class UsersItemController extends Controller
         $categories = Category::all();
         $subcategories = Subcategory::all();
 
-        return view('itemregister.item', [
-            'categories' => $categories,
-            'subcategories' => $subcategories,
-        ]);
+        return view('userprofile.index', [
+                'newItem' => true,
+                'categories' => $categories,
+                'subcategories' => $subcategories,
+            ]
+        );
+
     }
 
     public function store(StoreItemRequest $request)

+ 37 - 0
app/Http/Requests/ProfileRequest.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class ProfileRequest extends FormRequest
+{
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        return true;
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            'user_id' => 'required|integer|exists:users,id',
+            'name' => 'required|string|max:30',
+            'surname' => 'required|string|max:30',
+            'gender' => 'required',
+            'country' => 'required|string|max:40',
+            'city' => 'required|string|max:40 ',
+            'age' => 'required|integer|max:100',
+            'hobby' => 'required|string|max:70'
+        ];
+    }
+}

+ 28 - 0
app/Models/Profile.php

@@ -0,0 +1,28 @@
+<?php
+
+
+namespace App\Models;
+
+
+use Illuminate\Database\Eloquent\Model;
+
+class Profile extends Model
+{
+    public $timestamps = false;
+
+    protected $fillable = [
+        'name',
+        'user_id',
+        'surname',
+        'gender',
+        'country',
+        'city',
+        'age',
+        'hobby'
+    ];
+
+    public function user()
+    {
+        return $this->belongsTo('App\User');
+    }
+}

+ 1 - 1
composer.json

@@ -9,7 +9,7 @@
         "fideloper/proxy": "~4.0",
         "fobia/laravel-sphinx": "*",
         "guzzlehttp/guzzle": "^6.3",
-        "laravel/framework": "5.6.*",
+        "laravel/framework": "5.5.*",
         "laravel/tinker": "~1.0",
         "twbs/bootstrap": "4.0.0"
     },

File diff suppressed because it is too large
+ 233 - 240
composer.lock


+ 1 - 1
database/migrations/2018_04_15_165539_create_items_exchange_table.php

@@ -36,7 +36,7 @@ class CreateItemsExchangeTable extends Migration
      */
     public function down()
     {
-        Schema::table('pictures', function (Blueprint $table) {
+        Schema::table('items_exchange', function (Blueprint $table) {
             $table->dropForeign(['item_id']);
             $table->dropForeign(['item_offer_id']);
         });

+ 47 - 0
database/migrations/2018_04_21_182224_create_profiles_table.php

@@ -0,0 +1,47 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateProfilesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('profiles', function (Blueprint $table) {
+            $table->increments('id');
+            $table->unsignedInteger('user_id')->unique();
+            $table->string('name');
+            $table->string('surname');
+            $table->enum('gender', ['m', 'f',null])->nullable();
+            $table->string('country');
+            $table->string('city');
+            $table->integer('age');
+            $table->string('hobby');
+
+
+            $table->foreign('user_id')
+                ->references('id')->on('users')
+                ->onDelete('cascade');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('profiles', function (Blueprint $table) {
+            $table->dropForeign(['user_id']);
+
+        });
+        Schema::dropIfExists('profiles');
+    }
+}

+ 7 - 0
public/css/main.css

@@ -2,13 +2,20 @@
 
 body {
     background-image: url("/img/light-board-1.jpg");
+    /*padding-top: 70px;*/
 }
 
+<<<<<<< HEAD
 /*.navbar {*/
     /*height: 60px;*/
     /*border-radius: 0px;*/
     /*!*background-image: url("/img/8-temnyy-fon-tkani.png");*!*/
 /*}*/
+=======
+nav {
+    margin-bottom: 15px;
+}
+>>>>>>> 60ccba40973624db4e3dcf48e55ae2d7182c7110
 
 .login {
     display: inline-block;

+ 39 - 0
public/css/navbar.css

@@ -0,0 +1,39 @@
+@import url("https://fonts.googleapis.com/css?family=Raleway");
+
+#logo {
+    color: whitesmoke;
+    font-weight: 400;
+    font-size: 1.7em;
+    font-family: 'Raleway', sans-serif !important;
+    padding: 0;
+    text-shadow: 1px 1px 3px black, 0 0 1em #00b3ee;
+}
+
+#logo:hover {
+    text-shadow: 1px 1px 2px black, 0 0 2em red;
+}
+
+/*------- SEARCH INPUT ---------------------------------------*/
+#nav-search [type="submit"] {
+    color: #2e587c;
+    font-weight: 400;
+    text-shadow: 1px 1px 1px grey;
+    border-left: 1px solid lightgrey;
+}
+#nav-search form select {
+    border-radius: 0;
+    border-left: 0;
+    border-right: none;
+    background-color: #f9f9f2;
+}
+#nav-search #basic-addon {
+    background-color: white;
+}
+#nav-search .dropdown-toggle {
+    background-color: white;
+    border: 1px solid lightgrey;
+}
+#nav-search .dropdown-menu.show {
+    width: 100%;
+}
+/*------- END SEARCH INPUT ------------------------------------*/

+ 3 - 3
resources/lang/en/validation.php

@@ -45,7 +45,7 @@ return [
     'image'                => 'The :attribute must be an image.',
     'in'                   => 'The selected :attribute is invalid.',
     'in_array'             => 'The :attribute field does not exist in :other.',
-    'integer'              => 'The :attribute must be an integer.',
+    'integer'              => 'Поле :attribute должно быть целочисленным.',
     'ip'                   => 'The :attribute must be a valid IP address.',
     'ipv4'                 => 'The :attribute must be a valid IPv4 address.',
     'ipv6'                 => 'The :attribute must be a valid IPv6 address.',
@@ -68,7 +68,7 @@ return [
     'numeric'              => 'The :attribute must be a number.',
     'present'              => 'The :attribute field must be present.',
     'regex'                => 'The :attribute format is invalid.',
-    'required'             => 'The :attribute field is required.',
+    'required'             => 'Поле :attribute необходимо для заполнения.',
     'required_if'          => 'The :attribute field is required when :other is :value.',
     'required_unless'      => 'The :attribute field is required unless :other is in :values.',
     'required_with'        => 'The :attribute field is required when :values is present.',
@@ -118,4 +118,4 @@ return [
 
     'attributes' => [],
 
-];
+];

+ 2 - 2
resources/views/auth/login.blade.php

@@ -4,12 +4,12 @@
 <div class="container">
     <div class="row justify-content-center">
         <div class="col-md-8">
-            <div class="card">
+            <div class="card" style="margin-top:25px">
                 <div class="card-header">Login</div>
 
                 <div class="card-body">
                     <form method="POST" action="{{ route('login') }}">
-                        @csrf
+                        {{ csrf_field() }}
 
                         <div class="form-group row">
                             <label for="email" class="col-sm-4 col-form-label text-md-right">E-Mail Address</label>

+ 1 - 1
resources/views/auth/passwords/email.blade.php

@@ -15,7 +15,7 @@
                     @endif
 
                     <form method="POST" action="{{ route('password.email') }}">
-                        @csrf
+                        {{ csrf_field() }}
 
                         <div class="form-group row">
                             <label for="email" class="col-md-4 col-form-label text-md-right">E-Mail Address</label>

+ 1 - 1
resources/views/auth/passwords/reset.blade.php

@@ -9,7 +9,7 @@
 
                 <div class="card-body">
                     <form method="POST" action="{{ route('password.request') }}">
-                        @csrf
+                        {{ csrf_field() }}
 
                         <input type="hidden" name="token" value="{{ $token }}">
 

+ 2 - 2
resources/views/auth/register.blade.php

@@ -4,12 +4,12 @@
 <div class="container">
     <div class="row justify-content-center">
         <div class="col-md-8">
-            <div class="card">
+            <div class="card" style="margin-top:25px">
                 <div class="card-header">Register</div>
 
                 <div class="card-body">
                     <form method="POST" action="{{ route('register') }}">
-                        @csrf
+                        {{ csrf_field() }}
 
                         <div class="form-group row">
                             <label for="nickname" class="col-md-4 col-form-label text-md-right">Nickname</label>

+ 1 - 1
resources/views/categories/index.blade.php

@@ -9,7 +9,7 @@
                     <div class="card-header" style="float: left">Categories</div>
                     <div class="card-body">
                         <form method="POST" action="{{ route('category.store') }}">
-                            @csrf
+                            {{ csrf_field() }}
                             @foreach($categories as $category)
                                 <div class="form-group row">
                                     <label for="category" class="col-md-4 col-form-label text-md-right">{{$category->id}}</label>

+ 96 - 78
resources/views/itemregister/item.blade.php

@@ -1,87 +1,105 @@
-@extends('layouts.app')
+{{--@extends('layouts.app')--}}
 
-@section('navbar')
-@endsection
-@section('content')
+{{--@section('navbar')--}}
+{{--@endsection--}}
+{{--@section('content')--}}
 
-    <div class="container">
-        <div class="row">
-            <div class="col-md-6 col-md-offset-3" style="max-width:600px;min-width:600px;">
-                <div class="panel panel-primary">
-                    <div class="panel-heading">Предложить товар!</div>
-                    <div class="panel-body">
-                        <form method="POST" action="{{ route('item.store') }}">
-                            @csrf
-                            <div class="form-group">
-                                <label for="caption">Заголовок</label>
-                                <input type="text" id="caption" class="form-control" name="caption"
-                                       placeholder="Название товара">
-                            </div>
-                            <div class="form-group">
-                                <label for="category">Выберите категорию</label>
-                                <select id="category" class="form-control" name="category_id"
-                                        onchange="loadSubcategory(this)">
-                                    @foreach($categories as $category)
-                                        <option value="{{$category->id}}">{{$category->title}}</option>
-                                        {{--<option value="1">{{$category}}</option>--}}
-                                    @endforeach
-                                </select>
-                                @if ($errors->has('category'))
-                                    <span class="invalid-feedback">
-                        <strong>{{ $errors->first('category') }}</strong>
-                    </span>b
-                                @endif
-                            </div>
-                            <div class="form-group">
-                                <label for="subcategory">Выберите подкатегорию</label>
-                                <select id="subcategory" class="form-control" name="subcategory_id">
-                                    @foreach($subcategories as $subcategory)
-                                        <option value="{{$subcategory->id}}">{{$subcategory->title}}</option>
-                                        {{--<option value="1">{{$subcategory}}</option>--}}
-                                    @endforeach
-                                </select>
-                            </div>
-                            <div class="form-group">
-                                <label for="description">Описание</label>
-                                <textarea name="description" class="form-control" id="description" rows="3"></textarea>
-                            </div>
-                            @include('templates.image_upload')
-                            <div class="form-group text-center">
-                                <input hidden name="user_id" value="{{ \Illuminate\Support\Facades\Auth::id() }}">
-                                <button type="submit" class="btn btn-primary btn-lg" id="submitbtn" name="submit">
-                                    Сохранить
-                                </button>
-                            </div>
-                        </form>
-                    </div>
+<div class="container">
+    <div class="row">
+        <div class="col-md-6 col-md-offset-3" style="max-width:600px;min-width:600px;">
+            <div class="panel panel-primary">
+                <div class="panel-heading">Предложить товар!</div>
+                <div class="panel-body">
+                    {{--<form method="POST" action="{{ route('item.store') }}">--}}
+                    {{--{{ csrf_field() }}--}}
+                    {{--<div class="form-group">--}}
+                    {{--<label for="caption">Заголовок</label>--}}
+                    {{--<input type="text" id="caption" class="form-control" name="caption"--}}
+                    {{--placeholder="Название товара">--}}
+                    {{--</div>--}}
+                    {{--<div class="form-group">--}}
+                    {{--<label for="category">Выберите категорию</label>--}}
+                    {{--<select id="category" class="form-control" name="category_id"--}}
+                    {{--onchange="loadSubcategory(this)">--}}
+                    {{--@foreach($categories as $category)--}}
+                    {{--<option value="{{$category->id}}">{{$category->title}}</option>--}}
+                    {{--<option value="1">{{$category}}</option>--}}
+                    {{--@endforeach--}}
+                    {{--</select>--}}
+                    {{--@if ($errors->has('category'))--}}
+                    {{--<span class="invalid-feedback">--}}
+                    {{--=======--}}
+                    <form enctype="multipart/form-data" method="POST" action="{{ route('item.store') }}">
+                        {{ csrf_field() }}
+                        <div class="form-group">
+                            <label for="caption">Заголовок</label>
+                            <input type="text" id="caption" class="form-control" name="caption"
+                                   placeholder="Название товара">
+                        </div>
+                        <div class="form-group">
+                            <label for="category">Выберите категорию</label>
+                            <select id="category" class="form-control" name="category_id"
+                                    onchange="loadSubcategory(this)">
+                                <option value="" disabled>Выберите категорию</option>
+                                @foreach($categories as $category)
+                                    <option value="{{$category->id}}">{{$category->title}}</option>
+                                @endforeach
+                            </select>
+                            @if ($errors->has('category'))
+                                <span class="invalid-feedback">
+                                    <strong>{{ $errors->first('category') }}</strong>
+                                </span>
+                            @endif
+                        </div>
+                        <div class="form-group">
+                            <label for="subcategory">Выберите подкатегорию</label>
+                            <select id="subcategory" class="form-control" name="subcategory_id">
+                                <option value="" disabled>Выберите подкатегорию</option>
+                                @foreach($subcategories as $subcategory)
+                                    <option value="{{$subcategory->id}}">{{$subcategory->title}}</option>
+                                    {{--<option value="1">{{$subcategory}}</option>--}}
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="description">Описание</label>
+                            <textarea name="description" class="form-control" id="description" rows="3"></textarea>
+                        </div>
+                        @include('templates.image_upload')
+                        <div class="form-group text-center">
+                            <input hidden name="user_id" value="{{ \Illuminate\Support\Facades\Auth::id() }}">
+                            <button type="submit" class="btn btn-primary btn-lg" id="submitbtn" name="submit">
+                                Сохранить
+                            </button>
+                        </div>
+                    </form>
                 </div>
             </div>
         </div>
     </div>
-    <script>
-        function loadSubcategory(select) {
-            var subcategorySelect = $("#subcategory");
-            $.ajax({
-                url: '{{ route('form.ajax') }}',
-                data: {action: 'getSubcategory', category: select.value},
-                success: function (subcategoryList) {
-                    subcategorySelect.html('');
-                    $.each(subcategoryList, function (i, subcat) {
-                        console.log(subcat);
-                        console.log(subcat.title);
+</div>
 
-                        subcategorySelect.append('<option value="' + subcat.id + '">' + subcat.title + '</option>');
-                    });
+{{--@section('scripts')--}}
+{{--@parent--}}
+<script>
+    function loadSubcategory(select) {
+        var subcategorySelect = $("#subcategory");
+        $.ajax({
+            url: '{{ route('form.ajax') }}',
+            data: {action: 'getSubcategory', category: select.value},
+            success: function (subcategoryList) {
+                subcategorySelect.html('');
+                $.each(subcategoryList, function (i, subcat) {
+                    console.log(subcat);
+                    console.log(subcat.title);
 
-                    subcategorySelect.removeAttr('disabled');
+                    subcategorySelect.append('<option value="' + subcat.id + '">' + subcat.title + '</option>');
+                });
 
-                }
-            });
-
-            console.log('end');
-
-        }
-    </script>
-
-@endsection
-{{--@show--}}
+                subcategorySelect.removeAttr('disabled');
+            }
+        });
+        console.log('end');
+    }
+</script>
+{{--@endsection--}}

+ 2 - 2
resources/views/items/info_page.blade.php

@@ -85,7 +85,7 @@
                 @if (\Illuminate\Support\Facades\Auth::id())
                     <div id="leave-message" class="d-inline-block col-md-12">
                         <form method="POST" href="#">
-                            @csrf
+                            {{ csrf_field() }}
                             <input hidden name="item_id" value="{{ $item->id }}">
                             <input hidden name="user_id" value="{{ \Illuminate\Support\Facades\Auth::id() }}">
                             <textarea id="comment" name="comment"
@@ -135,7 +135,7 @@
                 <div class="modal-footer">
                     <form id="itemsExchangeForm" method="POST" role="form" hidden
                           action="{{ route('item.exchange.store',['item'=>$item->id]) }}">
-                        @csrf
+                        {{ csrf_field() }}
                         <input id="itemId" name="item_id" value="{{ $item->id }}" hidden>
                         <input id="itemOfferId" name="item_offer_id" value="" hidden>
                         <button type="submit" hidden>Предложить</button>

+ 1 - 1
resources/views/items/registration.blade.php

@@ -9,7 +9,7 @@
 
                     <div class="card-body">
                         <form method="POST" action="{{ route('item.store') }}">
-                            @csrf
+                            {{ csrf_field() }}
 
                             <div class="form-group row">
                                 <label for="caption" class="col-md-4 col-form-label text-md-right">Заголовок</label>

+ 16 - 12
resources/views/layouts/app.blade.php

@@ -8,7 +8,7 @@
     <!-- CSRF Token -->
     <meta name="csrf-token" content="{{ csrf_token() }}">
 
-    <title>{{ config('app.name', 'AWLEX') }}</title>
+    <title>{{ config('app.name') }}</title>
 
     <!-- Styles -->
     @section('styles')
@@ -20,28 +20,26 @@
         <link href="{{ asset('css/fontawesome-all.min.css') }}" rel="stylesheet">
         <link href="{{ asset('css/glyphicons.css') }}" rel="stylesheet">
 
-        <link href={{ asset('css/main.css') }} rel="stylesheet">
+        {{--<link href={{ asset('css/main.css') }} rel="stylesheet">--}}
     @endsection
     @yield('styles')
 
     @section('scripts-head')
         <script src="{{ asset('js/bootstrap.js') }}"></script>
         {{--<script src="{{ asset('js/jquery-3.3.1.min.js') }}"></script>--}}
-        {{--<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js"--}}
-        {{--integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl"--}}
-        {{--crossorigin="anonymous"></script>--}}
-        {{--<script defer src="/static/fontawesome/fontawesome-all.js"></script>--}}
-        {{--<script defer src="/static/fontawesome/fa-v4-shim.js"></script>--}}
-        <script src="https://code.jquery.com/jquery-3.3.1.min.js"
-                integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
-                crossorigin="anonymous"></script>
+
+        <script defer src="/static/fontawesome/fontawesome-all.js"></script>
+        <script defer src="/static/fontawesome/fa-v4-shim.js"></script>
+
     @endsection
 </head>
 
-<body class="hero-bkg-animated">
+{{--<body class="hero-bkg-animated">--}}
+<body>
 
 <!-- Navigation panel -->
 @section('navbar')
+    {{--    @include('layouts.navbar')--}}
     @include('layouts.navbar')
 @endsection
 @yield('navbar')
@@ -57,7 +55,13 @@
 
 <!-- Scripts -->
 @section('scripts')
-    <script src="{{ asset('js/app.js') }}"></script>
+
+    <script src="{{ asset('js/jquery-3.3.1.min.js') }}"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
+            integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
+            crossorigin="anonymous"></script>
+    <script src="{{ asset('js/bootstrap.4.min.js') }}"></script>
+    {{--<script src="{{ asset('js/app.js') }}"></script>--}}
 @endsection
 @yield('scripts')
 

+ 90 - 57
resources/views/layouts/navbar.blade.php

@@ -1,65 +1,98 @@
-<nav class="navbar navbar-dark bg-primary" style="margin-bottom: 20px">
-    <div class="container-fluid">
-        <!-- Brand and toggle get grouped for better mobile display -->
-        <div class="navbar-header" style="padding-right: 35px;padding-left: 20px">
-            <a class="navbar-brand" href="#" style="color: whitesmoke; font-weight: 500;font-size: 1.7em;">AWLEX</a>
-        </div>
+<link href="{{ asset('css/navbar.css') }}" rel="stylesheet">
+<nav class="navbar {{--fixed-top--}} navbar-expand-sm navbar-dark bg-primary">
 
-        <div class="navbar-header col-sm-4 col-md-3">
-            @include('templates.search_input',['categories'=>\App\Models\Category::getCategoriesWithSubcategories()])
-        </div>
+    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-content"
+            aria-controls="nav-content" aria-expanded="false" aria-label="Toggle navigation">
+        <span class="navbar-toggler-icon"></span>
+    </button>
+
+    <!-- Brand -->
+    <a id="logo" class="navbar-brand pl-3" href="/">{{ config('app.name') }}</a>
+
+    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-search"
+            aria-controls="nav-content" aria-expanded="false" aria-label="Toggle navigation">
+        <span class="glyphicon glyphicon-search small"></span>
+    </button>
+
+   <!-- Links -->
+    <div class="collapse navbar-collapse justify-content-sm-end" id="nav-content">
+        <div class="collapse navbar-collapse justify-content-lg-center" id="nav-search">
+            <form id="search-form" method="POST" action="{{ route('sphinx.search') }}" role="search"
+                  class="form-inline justify-content-sm-center">
+
+                <!-- Search Form -->
+                <!-- Old Search Form with Category List-->
+                {{--@include('templates.search_input',['categories'=>\App\Models\Category::getCategoriesWithSubcategories()])--}}
+
+                <div class="input-group">
+                    <div class="input-group-prepend">
+                        <span class="input-group-text" id="basic-addon">
+                            <span class="glyphicon glyphicon-search"></span>
+                        </span>
+                        <button type="button" class="btn btn-warning dropdown-toggle dropdown-toggle-split"
+                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                            <span class="sr-only">Toggle Dropdown</span>
+                        </button>
+                        <div class="dropdown-menu">
+                            <label for="subCat">Фильтровать по категории</label>
+                            <div class="input-group mb-2 mt-2">
+
+                                <select class="custom-select" name="subCat" id="subCat"
+                                        onclick="$(this).preventDefault()">
+                                    <option value="0" disabled selected hidden>Выберите категорию</option>
+                                    @isset($categories)
+                                        @foreach($categories as $category)
+                                            <optgroup label="{{ $category->title }}">
+                                                @foreach($category->subcategory as $subcategory )
+                                                    <option value="{{ $subcategory->id }}">{{ $subcategory->title }}</option>
+                                                @endforeach
+                                            </optgroup>
+                                        @endforeach
+                                    @endisset
+                                </select>
 
-        <ul class="nav navbar-nav navbar-right login list-inline" style="padding-right: 20px">
+                            </div>
+                        </div>
+                    </div>
+
+                    <input type="text" class="form-control" placeholder="Поисковая строка" aria-label="Search"
+                           aria-describedby="basic-addon">
+                    <div class="input-group-append">
+                        <button class="btn btn-warning" type="submit">Поиск</button>
+                    </div>
+                </div>
+            </form>
+        </div>
+        <ul class="navbar-nav">
+            <li class="nav-item">
+                <a class="nav-link" href="{{ route('dashboard') }}">Обменник</a>
+            </li>
             @guest
-            <li class="list-inline-item">
-                <a href="{{ route('register') }}"><span class="glyphicon glyphicon-user"></span> Регистрация</a>
+            <li class="nav-item">
+                <a class="nav-link" href="{{ route('register') }}">Регистрация </a>
             </li>
-            <li class="list-inline-item">
-                <a href="{{ route('login') }}"><span class="glyphicon glyphicon-log-in"
-                                                     style="margin-right: 8px;"></span>Войти</a>
+            <li class="nav-item">
+                <a class="nav-link" href="{{ route('login') }}">Войти </a>
             </li>
             @else
-                <li class="list-inline-item">
-                    <a class="nav-link" href="{{ route('dashboard') }}" role="button">
-                        {{--<span class="glyphicon glyphicon-plus"></span>--}}
-                        Обменник
-                    </a>
-                </li>
-                <li class="list-inline-item">
-                    <a class="nav-link" href="{{ route('user.item.create') }}" role="button">
-                        {{--<span class="glyphicon glyphicon-plus"></span>--}}
-                        Добавить лот
-                    </a>
-                </li>
-                <li class="list-inline-item">
-                    <a class="nav-link" href="{{ route('home') }}" role="button">{{ auth()->user()->nickname }}</a>
-                </li>
-                <li class="list-inline-item">
-                    <a class="nav-link"
-                       href="/logout" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
-                        Выход
-                    </a>
-                    <form id="logout-form" action="/logout" method="POST" style="display: none;">
-                        @csrf
-                    </form>
-
-                </li>
-                @endauth
+            <li class="nav-item dropdown">
+                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="{{ route('home') }}" role="button"
+                   aria-haspopup="true" aria-expanded="false">{{ auth()->user()->nickname }}</a>
+                <div class="dropdown-menu dropdown-menu-right">
+                    <a class="dropdown-item" href="{{--{{ route('user.index') }}--}}">Профиль</a>
+                    <a class="dropdown-item" href="#">Another action</a>
+                    <div class="dropdown-divider"></div>
+                    <a class="dropdown-item" href="{{ route('user.item.create') }}">Добавить лот</a>
+                </div>
+            </li>
+            <li class="nav-item">
+                <a class="nav-link" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"
+                   href="#">Выход</a>
+            </li>
+            <form id="logout-form" action="/logout" method="POST" style="display: none;">
+                {{ csrf_field() }}
+            </form>
+            @endauth
         </ul>
-
-    </div><!-- /.container-fluid -->
+    </div>
 </nav>
-@section('script')
-    @parent
-    <script>
-        $(document).ready(function (e) {
-            $('.search-panel .dropdown-menu').find('a').click(function (e) {
-                e.preventDefault();
-                var param = $(this).attr("href").replace("#", "");
-                var concept = $(this).text();
-                $('.search-panel span#search_concept').text(concept);
-                $('.input-group #search_param').val(param);
-            });
-        });
-    </script>
-@endsection

+ 4 - 5
resources/views/templates/item_small_view.blade.php

@@ -16,7 +16,7 @@
                             <i class="fa fa-user" aria-hidden="true"></i>
                         </a>
                         <a class="btn btn-raised btn-primary" href="#sendOffer" title="Предложить на обмен"
-                            data-item-id="{{ $item->id }}">
+                           data-item-id="{{ $item->id }}">
                             <i class="fa fa-envelope" aria-hidden="true"></i>
                         </a>
                         <a class="btn btn-raised btn-danger" href="#" title="Просмотреть">
@@ -27,14 +27,13 @@
                 <div class="card-body">
                     <div class="image float-right user-r">
                         @if(isset($item->picture[0]))
-                            <img src="{{ env('APP_URL'). '/image/' . $item->picture[0]->path }}" class="img-thumbnail" alt="avatar">
+                            <img src="{{ route('image.show', $item->picture[0]->path) }}" class="img-thumbnail" alt="avatar">
                         @else
-{{--                            <img src="{{ base_path('image/items/default') }} class="img-thumbnail" alt="avatar">--}}
-                            <img src="{{ env('APP_URL').'/image/items/default' }}" class="img-thumbnail" alt="avatar">
+                            <img src="{{ route('image.show', '/items/default') }}" class="img-thumbnail" alt="avatar">
                         @endif
                     </div>
                     <div class="description">
-                        <p class="card-text">{{ $item->description }}{{ $item->description }}</p>
+                        <p class="card-text">{{ $item->description }}</p>
                     </div>
                 </div>
             </div>

+ 1 - 1
resources/views/templates/modal_form.blade.php

@@ -31,7 +31,7 @@
 </script>
 
 <form id="item-fom" method="POST" action="{{ $route }}" enctype="multipart/form-data">
-    @csrf
+    {{ csrf_field() }}
     @method('POST')
 
     <div class="row">

+ 136 - 0
resources/views/userprofile/index.blade.php

@@ -0,0 +1,136 @@
+@extends('layouts.app')
+
+@section('content')
+    <style>
+        body {
+            /*background-image: url("public/img/fone.jpg");*/
+            background-color: deepskyblue;
+            background: linear-gradient(-85deg, deepskyblue, cadetblue);
+        }
+    </style>
+    <div class="row">
+        <div id="user-panel" class="col-md-3">
+
+            <div class="widget" style="background:#DEB887">
+                <h3>Страница пользователя</h3>
+                <ul>
+                    <li><a href="{{ route('user.profile') }}">Заполнить профиль</a></li>
+                    <li><a href="{{ route('user.item.create') }}">Добавить предмет</a></li>
+                    <li><a href="{{ route('user.items') }}">Мои предметы</a></li>
+                    <li><a href="">Мои обмены</a></li>
+                    <li><a href="">Архив</a></li>
+                </ul>
+            </div>
+
+            <style>
+                * {
+                    box-sizing: border-box;
+                    margin: 0;
+                }
+
+                .widget {
+                    padding: 20px;
+                    border: 5px solid #f1f1f1;
+                    background: #fff;
+                    border-radius: 5px;
+                    font-family: 'Roboto', sans-serif;
+                }
+
+                .widget h3 {
+                    margin-bottom: 20px;
+                    text-align: center;
+                    font-size: 24px;
+                    font-weight: normal;
+                    color: #424949;
+                }
+
+                .widget ul {
+                    margin: 0;
+                    padding: 0;
+                    list-style: none;
+                    width: 250px;
+                }
+
+                .widget li {
+                    border-bottom: 1px solid #eaeaea;
+                    padding-bottom: 20px;
+                    margin-bottom: 20px;
+                }
+
+                .widget li:last-child {
+                    border-bottom: none;
+                    margin-bottom: 0;
+                    padding-bottom: 0;
+                }
+
+                .widget a {
+                    text-decoration: none;
+                    color: #616a6b;
+                    display: inline-block;
+                }
+
+                .widget li:before {
+                    font-family: FontAwesome;
+                    font-size: 20px;
+                    vertical-align: bottom;
+                    color: #dd3333;
+                    margin-right: 14px;
+                }
+
+                .widget li:nth-child(1):before {
+                    content: "\f1ae";
+                }
+
+                .widget li:nth-child(2):before {
+                    content: "\f02d";
+                }
+
+                .widget li:nth-child(3):before {
+                    content: "\f030";
+                }
+
+                .widget li:nth-child(4):before {
+                    content: "\f155";
+                }
+
+                .widget li:nth-child(5):before {
+                    content: "\f19c";
+                }
+            </style>
+        </div>
+
+        <div class="col-md-8">
+            <div class="container">
+                @if(isset($contentContainer))
+                    @php echo $contentContainer @endphp
+                @endif
+                @if (isset($itemsList))
+                    {{--{!! dump($itemsList) !!}--}}
+
+                    {{--                @php echo view('userprofile.templates',['itemsList'=>$itemsList]) @endphp--}}
+                    @foreach($itemsList as $item)
+                        @include('templates.item_small_view',['item'=>$item])
+                    @endforeach
+                @endif
+
+                @if (isset($newItem))
+                    @php echo view('itemregister.item', [
+                                    'categories' => $categories,
+                            'subcategories' => $subcategories,
+                            ]);
+                    @endphp
+                @endif
+
+
+                {{--<img  src="public/img/fone.jpg" alt="Фон" width="100%">--}}
+            </div>
+        </div>
+    </div>
+@endsection
+
+@section('scripts')
+    @parent
+    <script>
+
+    </script>
+@endsection

+ 217 - 0
resources/views/userprofile/profile.blade.php

@@ -0,0 +1,217 @@
+<head>
+
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <title>Заполните профиль</title>
+    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"
+          integrity="sha256-3dkvEK0WLHRJ7/Csr0BZjAWxERc5WH7bdeUya2aXxdU= sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg=="
+          crossorigin="anonymous">
+    <!-- Bootstrap Core CSS -->
+    <!--     <link href="css/bootstrap.min.css" rel="stylesheet"> -->
+    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw=="
+          crossorigin="anonymous">
+
+    <!-- Custom CSS -->
+    <style>
+        body {
+            padding-top: 70px;
+            background: linear-gradient(to bottom, #00FA9A, #1E90FF);
+            /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
+        }
+
+        .othertop {
+            margin-top: 10px;
+        }
+
+
+    </style>
+
+    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+    <!--[if lt IE 9]>
+    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
+    <![endif]-->
+
+</head>
+
+<body>
+
+<div class="container">
+    {{--@php dump($profile) @endphp--}}
+    @if ($errors->any())
+        <div class="alert alert-danger">
+            <ul>
+                @foreach ($errors->all() as $error)
+                    <li>{{ $error }}</li>
+                @endforeach
+            </ul>
+        </div>
+    @endif
+    <div class="row">
+        <div class="col-md-10 ">
+            <form class="form-horizontal"  method="POST" action="{{ route('user.profile.store') }}">
+                {{ csrf_field() }}
+                <fieldset>
+
+                    <!-- Form Name -->
+                    <legend>Заполнение профиля</legend>
+
+                    <!-- Text input-->
+
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="Name ">Имя (Name)</label>
+                        <div class="col-md-4">
+                            <div class="input-group">
+                                <div class="input-group-addon">
+                                    <i class="fa fa-user">
+                                    </i>
+                                </div>
+                                <input id="Имя (Name)" name="name" type="text" placeholder="Имя (Name)"
+                                       class="form-control input-md" value="{{ $profile->name ?? "" }}">
+                            </div>
+
+
+                        </div>
+
+
+                    </div>
+
+                    <!-- Text input-->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="surname">Фамилия (Surname)</label>
+                        <div class="col-md-4">
+
+                            <div class="input-group">
+                                <div class="input-group-addon">
+                                    <i class="fa fa-male" style="font-size: 20px;"></i>
+
+                                </div>
+                                <input id="Фамилия (Surname)" name="surname" type="text" placeholder="Фамилия (Surname)"
+                                       class="form-control input-md" value="{{ $profile->surname ?? "" }}">
+                            </div>
+
+
+                        </div>
+                    </div>
+
+
+                    <!-- Multiple Radios (inline) -->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="Gender">Пол (Gender)</label>
+                        <div class="col-md-4">
+                            <label class="radio-inline" for="Gender-0">
+                                <input type="radio" name="gender" id="Gender-0" value="1" {{ ($profile->gender === "1") ? "checked='checked'" : "" }}>
+                                Male
+                            </label>
+                            <label class="radio-inline" for="Gender-1">
+                                <input type="radio" name="gender" id="Gender-1" value="2" {{ ($profile->gender === "2") ? "checked='checked'" : "" }}>
+                                Female
+                            </label>
+                        </div>
+                    </div>
+
+                    <!-- Text input-->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="Country">Страна (Country)</label>
+                        <div class="col-md-4">
+                            <div class="input-group">
+                                <div class="input-group-addon" >
+                                    <i class="fa fa-home"></i>
+
+                                </div>
+                                <input id="Country" name="country" type="text" placeholder="Страна (Country)"
+                                       class="form-control input-md" value="{{ $profile->country ?? "" }}">
+                            </div>
+
+                        </div>
+                    </div>
+
+                    <!-- Text input-->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="City">Город (City)</label>
+                        <div class="col-md-4">
+                            <div class="input-group">
+                                <div class="input-group-addon">
+                                    <i class="fa fa-home"></i>
+
+                                </div>
+                                <input id="City" name="city" type="text" placeholder="Город (City)"
+                                       class="form-control input-md" value="{{ $profile->city ?? "" }}">
+                            </div>
+
+
+                        </div>
+                    </div>
+
+                    <!-- Text input-->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="Age">Возраст (Age)</label>
+                        <div class="col-md-4">
+                            <div class="input-group">
+                                <div class="input-group-addon">
+                                    <i class="fa fa-calendar"></i>
+
+                                </div>
+                                <input id="Age" name="age" type="text" placeholder="Возраст (Age)"
+                                       class="form-control input-md" value="{{ $profile->age ?? "" }}">
+                            </div>
+
+
+                        </div>
+                    </div>
+
+                    <!-- Text input-->
+                    <div class="form-group">
+                        <label class="col-md-4 control-label" for="Hobby">Хобби (Hobby)</label>
+                        <div class="col-md-4">
+                            <div class="input-group">
+                                <div class="input-group-addon">
+                                    <i class="fa fa-camera-retro"></i>
+
+                                </div>
+                                <input id="Hobby" name="hobby" type="text" placeholder="Хобби (Hobby)"
+                                       class="form-control input-md" value="{{ $profile->hobby ?? "" }}">
+
+                            </div>
+
+                        </div>
+                    </div>
+
+                    <div class="form-group text-center">
+                        <input hidden name="user_id" value="{{ Auth::id() }}">
+                        <button type="submit" class="btn btn-primary btn-lg">
+                            Сохранить
+                        </button>
+                    </div>
+
+                    <div class="text-center">
+                        <button type="submit" class="btn btn-primary btn-lg">
+                            Назад
+                        </button>
+                    </div>
+
+                </fieldset>
+            </form>
+        </div>
+        <div class="col-md-2 hidden-xs">
+            <img src="http://websamplenow.com/30/userprofile/images/avatar.jpg" class="img-responsive img-thumbnail ">
+        </div>
+
+
+    </div>
+</div>
+<!-- jQuery Version 1.11.1 -->
+<script src="js/jquery.js"></script>
+
+<!-- Bootstrap Core JavaScript -->
+<script src="js/bootstrap.min.js"></script>
+
+</body>
+
+</html>

+ 82 - 0
resources/views/userprofile/profile_form.blade.php

@@ -0,0 +1,82 @@
+<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
+<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
+
+<!------ Include the above in your HEAD tag ---------->
+
+<form class="form-horizontal" method="post" action="{{ route('user.profile.store') }}">
+    <fieldset>
+
+        <!-- Form Name -->
+        <legend>Информация о пользователе</legend>
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Имя</label>
+            <div class="col-md-4">
+                <input disabled id="Имя (Name)" name="name" type="text" placeholder="Имя (Name)"
+                       class="form-control input-md" value="{{ $profile->name ?? "" }}">
+
+            </div>
+        </div>
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Фамилия</label>
+            <div class="col-md-4">
+                <input disabled id="Фамилия (Surname)" name="surname" type="text" placeholder="Фамилия (Surname)"
+                       class="form-control input-md" value="{{ $profile->surname ?? "" }}">
+
+            </div>
+        </div>
+
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Пол</label>
+            <div class="col-md-4">
+                <input disabled id="Пол (Gender)" name="gender" type="text" placeholder="Пол (Gender)"
+                       class="form-control input-md" value="{{ $profile->gender=='m' ? 'Мужской':'Женский'}}">
+            </div>
+        </div>
+
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Страна</label>
+            <div class="col-md-4">
+                <input disabled id="Country" name="country" type="text" placeholder="Страна (Country)"
+                       class="form-control input-md" value="{{ $profile->country ?? "" }}">
+
+            </div>
+        </div>
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Город</label>
+            <div class="col-md-4">
+                <input disabled id="City" name="city" type="text" placeholder="Город (City)"
+                       class="form-control input-md" value="{{ $profile->city ?? "" }}">
+
+            </div>
+        </div>
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Возраст</label>
+            <div class="col-md-4">
+                <input disabled id="Age" name="age" type="text" placeholder="Возраст (Age)"
+                       class="form-control input-md" value="{{ $profile->age ?? "" }}">
+
+            </div>
+        </div>
+
+        <!-- Text input-->
+        <div class="form-group">
+            <label class="col-md-4 control-label" for="textinput">Хобби</label>
+            <div class="col-md-4">
+                <input disabled id="Hobby" name="hobby" type="text" placeholder="Хобби (Hobby)"
+                       class="form-control input-md" value="{{ $profile->hobby ?? "" }}">
+
+            </div>
+        </div>
+
+    </fieldset>
+</form>

+ 121 - 0
resources/views/userprofile/templates.blade.php

@@ -0,0 +1,121 @@
+{{--@extends('layouts.app')--}}
+
+{{--@section('content')--}}
+
+{{--<link href="{{ asset('css/item_info_page.css') }}" rel="stylesheet">--}}
+{{--<link href="{{ asset('css/bootstrap.4.min.css') }}" rel="stylesheet">--}}
+{{--<script src="{{ asset('js/bootstrap.4.min.js') }}"></script>--}}
+
+<style>
+
+    .wraper-top {
+        min-height: 50px;
+    }
+
+    .item-small-view {
+        margin-top: 20px;
+        max-width: 600px;
+        min-width: 600px;
+        height: 175px;
+    }
+
+    .item-small-view .description {
+        overflow: hidden;
+        max-height: 110px;
+        text-align: left;
+    }
+    #item-small-view img {
+        width: 100%;
+        height: 100%;
+    }
+
+    #item-small-view div {
+        min-height: 100px;
+        max-height: 100px;
+        overflow: hidden;
+
+    }
+
+    #item-small-preview {
+        padding: 5px;
+        background-color: #cccccc;
+        max-width: 100px;
+        min-width: 100px;
+    }
+
+    #item-small-information {
+        padding: 5px;
+        background-color: lightgoldenrodyellow;
+    }
+
+    .card-body .card-text {
+        font-size: 15px;
+    }
+
+    #item-small-manipulate {
+        padding: 5px;
+        background-color: #cccccc;
+        max-width: 50px;
+        min-width: 50px;
+    }
+
+
+    .user-r {
+        padding-left: 6px;
+    }
+    .user-l >img,
+    .user-r >img {
+        width: 150px;
+    }
+    .redes >ul li a {
+        width: 42px;
+        margin-left: 5px;
+        margin-right: 5px;
+        text-align: center;
+        border-radius: 10em;
+        border: #EEE 1px solid;
+    }
+    .redes >ul li span {
+        color: #CCC;
+        font-size: 18px;
+    }
+    .footer {
+        padding: 16px 0;
+    }
+
+
+
+</style>
+
+<div class="wraper-top">
+</div>
+
+@foreach($itemsList as $item)
+    <div class="col-md-12 item-small-view">
+        <div class="card">
+            <h4 class="card-header text-right bg-dark text-white">{{ $item->caption }}
+                <div class="float-left small">
+                    <a class="btn btn-raised btn-danger" href="#" title="Ver perfil de Miguel92" data-toggle="tooltip" data-placement="top">
+                        <i class="fa fa-user" aria-hidden="true"></i>
+                    </a>
+                    <a class="btn btn-raised btn-danger" href="#" title="Enviar mensaje">
+                        <i class="fa fa-envelope" aria-hidden="true"></i>
+                    </a>
+                    <a class="btn btn-raised btn-danger" href="#" title="Seguir usuario">
+                        <i class="fa fa-eye" aria-hidden="true"></i>
+                    </a>
+                </div>
+            </h4>
+            <div class="card-body">
+                <div class="image float-right user-r">
+                    <img src="image/{{ $item->picture[0]->path }}" class="img-thumbnail" alt="avatar">
+                </div>
+                {{--<h4 class="card-title">{{ $item->caption }}</h4>--}}
+                <div class="description">
+                    <p class="card-text">{{ $item->description }}</p>
+                </div>
+            </div>
+        </div>
+    </div>
+@endforeach
+{{--@endsection--}}

+ 1 - 1
resources/views/welcome.blade.php

@@ -95,7 +95,7 @@
                             Выход
                         </a>
                         <form id="logout-form" action="/logout" method="POST" style="display: none;">
-                            @csrf
+                            {{ csrf_field() }}
                         </form>
                     </li>
                 @else

+ 13 - 5
routes/web.php

@@ -68,11 +68,19 @@ Route::group(['prefix' => 'user', 'middleware' => ['auth']], function () {
 
 //--------- USERS ROUTES ---------------------------------------------------------------------------
 
-Route::get('/users/item/index', 'UsersItemController@index');
+Route::group(['prefix' => 'user', 'middleware' => ['auth']], function () {
+    Route::get('/item/index', 'UsersItemController@index');
+    Route::get('/item', 'UsersItemController@create')->name('user.item.create');
+    Route::post('/item/', 'UsersItemController@store')->name('item.store');
+    Route::any('/form/ajax', "RegisterItemController@jsonSubcategoryRequest")->name('form.ajax');
+
+    Route::get('/home', "ProfileController@index")->name('home');
+    Route::any('/items', "ProfileController@showAllItems")->name('user.items');
 
-Route::get('/users/item', 'UsersItemController@create')->name('user.item.create');
-Route::post('/users/item/', 'UsersItemController@store')->name('item.store');
-Route::any('/users/form/ajax', "RegisterItemController@jsonSubcategoryRequest")->name('form.ajax');
+    Route::get('/profile', "RegisterProfileController@create")->name('user.profile');
+    Route::post('/profile', "RegisterProfileController@store")->name('user.profile.store');
+
+});
 
 //------- OUT OF AUTH ROUTEs -----------------------------------------------------------------------
 Route::get('/dashboard', 'DashboardController@index')->name('dashboard');
@@ -100,4 +108,4 @@ Route::get('/item/{item}', 'ItemsInfoController@show');     /// это долж
 Auth::routes();
 
 //Route::get('/', 'HomeController@welcome')->name('welcome');
-Route::get('/home', 'HomeController@index')->name('home');
+Route::get('/home', 'HomeController@index');

+ 0 - 1
storage/sphinx/.gitignore

@@ -1 +0,0 @@
-./data/

+ 11 - 11
storage/sphinx/etc/sphinx-awlex.conf

@@ -7,8 +7,8 @@ source awlex-db
 	type			    = mysql
 
 	sql_host		    = localhost
-	sql_user		    = root
-	sql_pass		    =
+	sql_user		    = awlex
+	sql_pass		    = VskbIskJ
 	sql_db			    = awlex
 	sql_port		    = 3306	# optional, default is 3306
 
@@ -52,7 +52,7 @@ source src_items : awlex-db
 index items
 {
 	source			    = src_items
-	path			    = storage/sphinx/data/items/items_index
+	path			    = /home/awlex/public_html/awlex_site/storage/sphinx/data/items/items_index
 	#morphology          = stem_ru
     morphology          = lemmatize_ru_all, stem_en
 	min_word_len        = 3
@@ -67,7 +67,7 @@ index items_rt
 {
 	type			    = rt
 	rt_mem_limit	    = 128M
-	path			    = storage/sphinx/data/items/items_rt
+	path			    = /home/awlex/public_html/awlex_site/storage/sphinx/data/items/items_rt
 	rt_field		    = caption
 	rt_field		    = description
 	rt_attr_uint	    = subcategory_id
@@ -86,14 +86,14 @@ source src_items_light : awlex-db
 index items_light : items
 {
     source			    = src_items_light
-    path			    = storage/sphinx/data/items_light/items_light_index
+    path			    = /home/awlex/public_html/awlex_site/storage/sphinx/data/items_light/items_light_index
 }
 
 index items_light_rt
 {
 	type			    = rt
 	rt_mem_limit	    = 128M
-	path			    = storage/sphinx/data/items_light/items_light_rt
+	path			    = /home/awlex/public_html/awlex_site/storage/sphinx/data/items_light/items_light_rt
 	rt_field		    = caption
 	rt_field		    = description
 	rt_attr_uint	    = subcategory_id
@@ -102,7 +102,7 @@ index items_light_rt
 #---------------------------------------------------------------------------
 
 common {
-    lemmatizer_base = sphinx-3.0.2/dict
+    lemmatizer_base = /home/awlex/public_html/awlex_site/sphinx-3.0.2/dict
 }
 
 indexer
@@ -115,14 +115,14 @@ searchd
 {
 	listen			    = 9312
 	listen			    = 9306:mysql41
-	log			        = storage/sphinx/log/searchd.log
-	query_log		    = storage/sphinx/log/query.log
+	log			        = /home/awlex/public_html/awlex_site/storage/sphinx/log/searchd.log
+	query_log		    = /home/awlex/public_html/awlex_site/storage/sphinx/log/query.log
 	read_timeout	    = 5
 	max_children	    = 20
-	pid_file		    = storage/sphinx/log/searchd.pid
+	pid_file		    = /home/awlex/public_html/awlex_site/storage/sphinx/log/searchd.pid
 	seamless_rotate	    = 1
 	preopen_indexes	    = 1
 	unlink_old		    = 1
 	workers			    = threads # for RT to work
-	binlog_path		    = storage/sphinx/data/binlog
+	binlog_path		    = /home/awlex/public_html/awlex_site/storage/sphinx/data/binlog
 }

+ 0 - 0
storage/sphinx/log/query.log


+ 25 - 0
storage/sphinx/log/searchd.log

@@ -0,0 +1,25 @@
+[Mon Apr 23 20:01:00.239 2018] [19069] watchdog: main process 19070 forked ok
+[Mon Apr 23 20:01:00.241 2018] [19070] listening on all interfaces, port=9312
+[Mon Apr 23 20:01:00.241 2018] [19070] listening on all interfaces, port=9306
+[Mon Apr 23 20:01:00.294 2018] [19070] FATAL: failed to open '/home/awlex/public_html/awlex_site/storage/sphinx/data/binlog/binlog.lock': 2 'No such file or directory'
+[Mon Apr 23 20:01:00.296 2018] [19069] watchdog: main process 19070 exited cleanly (exit code 1), shutting down
+[Mon Apr 23 20:01:17.288 2018] [19106] watchdog: main process 19107 forked ok
+[Mon Apr 23 20:01:17.289 2018] [19107] listening on all interfaces, port=9312
+[Mon Apr 23 20:01:17.289 2018] [19107] listening on all interfaces, port=9306
+[Mon Apr 23 20:01:17.348 2018] [19107] accepting connections
+[Mon Apr 23 20:16:36.717 2018] [19107] caught SIGTERM, shutting down
+[Mon Apr 23 20:16:37.281 2018] [19107] rt: index items_rt: ramchunk saved in 0.448 sec
+[Mon Apr 23 20:16:37.335 2018] [19107] shutdown complete
+[Mon Apr 23 20:16:37.336 2018] [19106] watchdog: main process 19107 exited cleanly (exit code 0), shutting down
+[Mon Apr 23 20:17:04.977 2018] [21208] watchdog: main process 21209 forked ok
+[Mon Apr 23 20:17:04.978 2018] [21209] listening on all interfaces, port=9312
+[Mon Apr 23 20:17:04.978 2018] [21209] listening on all interfaces, port=9306
+[Mon Apr 23 20:17:05.042 2018] [21209] accepting connections
+[Mon Apr 23 20:17:13.425 2018] [21209] caught SIGTERM, shutting down
+[Mon Apr 23 20:17:15.584 2018] [21209] rt: index items_rt: ramchunk saved in 0.396 sec
+[Mon Apr 23 20:17:15.681 2018] [21209] shutdown complete
+[Mon Apr 23 20:17:15.683 2018] [21208] watchdog: main process 21209 exited cleanly (exit code 0), shutting down
+[Mon Apr 23 22:22:00.486 2018] [21910] watchdog: main process 21911 forked ok
+[Mon Apr 23 22:22:00.487 2018] [21911] listening on all interfaces, port=9312
+[Mon Apr 23 22:22:00.488 2018] [21911] listening on all interfaces, port=9306
+[Mon Apr 23 22:22:00.553 2018] [21911] accepting connections