Skip to content

Commit

Permalink
Declared strict type in class files
Browse files Browse the repository at this point in the history
  • Loading branch information
Slymee committed Jan 18, 2024
1 parent acf8971 commit 166e47a
Show file tree
Hide file tree
Showing 31 changed files with 59 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/CategoryController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/PasswordResetController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
7 changes: 5 additions & 2 deletions app/Http/Controllers/ProductAdController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

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

Expand All @@ -10,9 +12,10 @@ class ProductAdController extends Controller
/**
* Display a listing of the resource.
*/
public function index()
public function index(Category $category)
{
return view('userend.create-product');
$mainParent = $category->whereNull('parent_id')->paginate(10);
return view('userend.create-product', compact('mainParent'));
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/UserPasswordResetController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Controllers;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Middleware/GuestAuthenticate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Middleware;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Middleware/LoginPageAuthenticate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Middleware;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/CategoryRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Requests;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/ForgotPasswordRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Requests;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/LoginRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Requests;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/RegisterUserRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Requests;

Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/ResetPasswordRequest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Http\Requests;

Expand Down
1 change: 1 addition & 0 deletions app/Models/Admin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Models;

Expand Down
1 change: 1 addition & 0 deletions app/Models/Category.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Models;

Expand Down
1 change: 1 addition & 0 deletions app/Models/CategoryProduct.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Models;

Expand Down
1 change: 1 addition & 0 deletions app/Models/ProductAd.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Models;

Expand Down
1 change: 1 addition & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace App\Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/create-product.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

.error-message{
color: red;
}
4 changes: 1 addition & 3 deletions resources/views/commonComponents/admin-category.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@
@foreach ($category->children as $child)
@include('commonComponents.admin-category', ['category' => $child])
@endforeach
@endif


@endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<option value="{{ $category->id }}">{{ $category->category_name }}</option>


@if ($category->children->isNotEmpty())
@foreach ($category->children as $child)
@include('userend.commonComponents.create-product-category', ['category' => $child])
@endforeach
@endif
19 changes: 15 additions & 4 deletions resources/views/userend/create-product.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,24 @@
</div>
<div class="mb-3">
<select class="form-select" size="3" aria-label="size 3 select example" id="categories">
<option selected>Select Categories</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option selected value="">Select Categories</option>
@foreach ($mainParent as $parentCategory)
@include('userend.commonComponents.create-product-category', ['category' => $parentCategory])
@endforeach
</select>
</div>
<input class="btn btn-primary" type="submit" value="Create Ad">
<span class="error-message">
@if(session('message'))
{{ session('message') }}
@endif

@if($errors->any())
@foreach ($errors->all() as $error)
{{ $error}} <br>
@endforeach
@endif
</span>
</form>
</div>
</section>
Expand Down

0 comments on commit 166e47a

Please sign in to comment.