diff --git a/app/Http/Controllers/ListingController.php b/app/Http/Controllers/ListingController.php new file mode 100644 index 0000000..19db2ce --- /dev/null +++ b/app/Http/Controllers/ListingController.php @@ -0,0 +1,66 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdateListingRequest.php b/app/Http/Requests/UpdateListingRequest.php new file mode 100644 index 0000000..a3b58e3 --- /dev/null +++ b/app/Http/Requests/UpdateListingRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Models/Listing.php b/app/Models/Listing.php new file mode 100644 index 0000000..d61b376 --- /dev/null +++ b/app/Models/Listing.php @@ -0,0 +1,12 @@ + */ + use HasFactory; +} diff --git a/app/Policies/ListingPolicy.php b/app/Policies/ListingPolicy.php new file mode 100644 index 0000000..a0c4e43 --- /dev/null +++ b/app/Policies/ListingPolicy.php @@ -0,0 +1,66 @@ + + */ +class ListingFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2025_11_05_094705_create_listings_table.php b/database/migrations/2025_11_05_094705_create_listings_table.php new file mode 100644 index 0000000..e5cf3a5 --- /dev/null +++ b/database/migrations/2025_11_05_094705_create_listings_table.php @@ -0,0 +1,33 @@ +id(); + $table->timestamps(); + $table->text('title')->nullable(false); + $table->text('description')->nullable(false); + $table->text('location')->nullable(false); + $table->decimal('price')->default(0.0); + $table->foreignIdFor(User::class)->nullable(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('listings'); + } +}; diff --git a/database/seeders/ListingSeeder.php b/database/seeders/ListingSeeder.php new file mode 100644 index 0000000..0ae1bf7 --- /dev/null +++ b/database/seeders/ListingSeeder.php @@ -0,0 +1,17 @@ +user(); })->middleware('auth:sanctum'); + +Route::resource('/listing', ListingController::class);