-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
212 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\CategoryAndSubCategory; | ||
use Illuminate\Http\Request; | ||
|
||
class CategoryAndSubCategoryController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
return view('backend.adminCategory'); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
*/ | ||
public function create() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show(CategoryAndSubCategory $categoryAndSubCategory) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
*/ | ||
public function edit(CategoryAndSubCategory $categoryAndSubCategory) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, CategoryAndSubCategory $categoryAndSubCategory) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy(CategoryAndSubCategory $categoryAndSubCategory) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class CategoryAndSubCategory extends Model | ||
{ | ||
use HasFactory; | ||
} |
33 changes: 33 additions & 0 deletions
33
database/migrations/2023_12_19_083610_create_category_and_sub_categories_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('category_and_sub_categories', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('category_name'); | ||
$table->integer('parent_id')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::table('category_and_sub_categories', function (Blueprint $table) { | ||
$table->foreign('parent_id')->references('id')->on('category_and_sub_categories'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('category_and_sub_categories'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.add-button-container{ | ||
padding: 10px; | ||
} | ||
|
||
.add-button-container>a>button{ | ||
padding: 10px; | ||
width: 20%; | ||
border: none; | ||
font-size: 20px; | ||
cursor: pointer; | ||
color: rgb(61,81,181); | ||
color: linear-gradient(313deg, rgba(61,81,181,1) 0%, rgba(77,103,255,1) 52%, rgba(92,137,180,1) 100%); | ||
border: 1px solid rgb(61,81,181);; | ||
} | ||
|
||
.add-button-container>a>button:hover{ | ||
background: rgb(61,81,181); | ||
background: linear-gradient(313deg, rgba(61,81,181,1) 0%, rgba(77,103,255,1) 52%, rgba(92,137,180,1) 100%); | ||
color: white; | ||
} | ||
|
||
.display-data-container{ | ||
padding: 10px; | ||
} | ||
|
||
.display-data-container>span{ | ||
font-size: 24px; | ||
} | ||
|
||
.table-container{ | ||
padding: 10px; | ||
} | ||
|
||
.table-container>table, th, td{ | ||
border: 1px solid; | ||
border-collapse: collapse; | ||
text-align: center; | ||
padding: 10px; | ||
font-size: 18px; | ||
} | ||
|
||
.table-container>table{ | ||
width: 100%; | ||
font-size: 18px; | ||
margin: 0 auto; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
.content-container{ | ||
width: 100%; | ||
height: 100vh; | ||
padding: 10px; | ||
} | ||
|
||
.statistics{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/fontawesome.min.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css" /> | ||
<link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'> | ||
@vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css', 'resources/css/admin-dashboard-category.css']) | ||
<title>Dashboard - Category</title> | ||
</head> | ||
<body> | ||
<section> | ||
<div class="side-nav"> | ||
@include('commonComponents.side-nav') | ||
</div> | ||
<div class="side-container"> | ||
@include('commonComponents.bread-crumb') | ||
<div class="content-container"> | ||
<div class="add-button-container"> | ||
<a href=""><button>Add Category</button></a> | ||
</div> | ||
<div class="display-data-container"> | ||
<span>Categories</span> | ||
|
||
<div class="table-container"> | ||
<table> | ||
<tr> | ||
<th>SN</th> | ||
<th>Name</th> | ||
<th colspan="2">Utilities</th> | ||
</tr> | ||
|
||
<tr> | ||
<td>1</td> | ||
<td>Fruit</td> | ||
<td><button>Edit</button></td> | ||
<td><button>Delete</button></td> | ||
</tr> | ||
|
||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters