-
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
9 changed files
with
146 additions
and
19 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
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
28 changes: 28 additions & 0 deletions
28
database/migrations/2024_05_07_172217_add_is_admin_column_to_users_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,28 @@ | ||
<?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::table('users', function (Blueprint $table) { | ||
$table->boolean('is_admin')->default(false); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
$table->dropColumn('is_admin'); | ||
}); | ||
} | ||
}; |
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 |
---|---|---|
|
@@ -20,6 20,7 @@ public function run(): void | |
User::factory()->create([ | ||
'name' => 'Test User', | ||
'email' => '[email protected]', | ||
'is_admin' => true | ||
]); | ||
User::factory()->create([ | ||
'name' => 'Test2 User', | ||
|
@@ -28,5 29,8 @@ public function run(): void | |
Listing::factory(20)->create([ | ||
'by_user_id' => 1 | ||
]); | ||
Listing::factory(20)->create([ | ||
'by_user_id' => 2 | ||
]); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,15 @@ | ||
<template> | ||
<div class="flex gap-1"> | ||
<Link v-for="(link, index) in links" :key="index" class="py-2 px-4 rounded-md" | ||
:href="link.url" | ||
:class="{'bg-indigo-500 dark:bg-indigo-800 text-gray-300' : link.active}" | ||
v-html="link.label"> | ||
|
||
</Link> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import {Link} from "@inertiajs/vue3"; | ||
defineProps({links: Array}) | ||
</script> |
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,32 @@ | ||
<template> | ||
<form action=""> | ||
<div class="flex flex-wrap gap-2 mt-2 mb-8"> | ||
<div class="flex flex-nowrap items-center"> | ||
<input type="text" name="" id="" placeholder="Price from" class="input-filter-l w-28"> | ||
<input type="text" name="" id="" placeholder="Price to" class="input-filter-r w-28"> | ||
</div> | ||
|
||
<div class="flex flex-nowrap items-center"> | ||
<select name="" id="" class="input-filter-l w-28"> | ||
<option :value="null">Beds</option> | ||
<option v-for="n in 5 " :key="n" :value="n">{{ n }}</option> | ||
<option :value="null">6 </option> | ||
</select> | ||
<select name="" id="" class="input-filter-r w-28"> | ||
<option :value="null">Baths</option> | ||
<option v-for="n in 5 " :key="n" :value="n">{{ n }}</option> | ||
<option :value="null">6 </option> | ||
</select> | ||
</div> | ||
|
||
<div class="flex flex-nowrap items-center"> | ||
<input type="text" name="" id="" placeholder="Area from" class="input-filter-l w-28"> | ||
<input type="text" name="" id="" placeholder="Area to" class="input-filter-r w-28"> | ||
</div> | ||
<button type="submit" class="btn-normal">Filter</button> | ||
<button type="reset" class="btn-normal">Clear</button> | ||
</div> | ||
</form> | ||
</template> | ||
|
||
<script setup></script> |
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 |
---|---|---|
@@ -1,12 1,20 @@ | ||
<template> | ||
|
||
<Filters/> | ||
|
||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4"> | ||
<Listing v-for="listing in listings" :key="listing.id" :listing="listing" /> | ||
<Listing v-for="listing in listings.data" :key="listing.id" :listing="listing" /> | ||
</div> | ||
|
||
<div v-if="listings.data.length" class="w-full flex justify-center mt-4 mb-4"> | ||
<Pagination :links="listings.links"></Pagination> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { useMonthlyPayment } from "@/Composables/useMonthlyPayment.js"; | ||
import Listing from "@/Pages/Listing/Index/Components/listing.vue"; | ||
defineProps({ listings: Array }); | ||
import Pagination from "@/Components/UI/pagination.vue"; | ||
import Filters from "@/Pages/Index/Components/filters.vue" | ||
defineProps({ listings: Object }); | ||
</script> |