Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
fix small view detail
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed May 11, 2022
1 parent f74734e commit 1948c5f
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 14 deletions.
10 changes: 10 additions & 0 deletions app/Http/Controllers/BasicViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;
use App\Models\Review;
use App\Models\SubscriptionEmail;

use Illuminate\Http\Request;

Expand Down Expand Up @@ -45,4 +46,13 @@ public function about()
{
return view('about');
}

public function subscribe() {
$email = request()->input('email');
$subscription = SubscriptionEmail::firstOrCreate(['email' => $email]);

$redirect_url = request()->header('referer');

return redirect($redirect_url);
}
}
15 changes: 15 additions & 0 deletions app/Models/SubscriptionEmail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SubscriptionEmail extends Model
{
use HasFactory;

protected $fillable = [
'email',
];
}
2 changes: 2 additions & 0 deletions app/View/Components/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class Footer extends Component
{
public $success = "";

/**
* Create a new component instance.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('subscription_emails', function (Blueprint $table) {
$table->id();
$table->string('email');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('subscription_emails');
}
};
4 changes: 4 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,10 @@ select {
--tw-bg-opacity: 1;
background-color: rgb(243 244 248 / var(--tw-bg-opacity));
}
.bg-gray-50 {
--tw-bg-opacity: 1;
background-color: rgb(93 93 148 / var(--tw-bg-opacity));
}
.fill-current {
fill: currentColor;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/auth-card.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="min-h-screen flex flex-col sm:justify-center items-center sm:pt-0 bg-">
<div class="min-h-screen flex flex-col justify-center items-center">
<div class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white shadow-md overflow-hidden sm:rounded-lg">
{{ $slot }}
</div>
Expand Down
13 changes: 8 additions & 5 deletions resources/views/components/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
<div class="mb-5">
<a href="{{ url('/') }} "><div class="navbar-logo basis-1/4 text-lilac-100">Rent.ly</div></a>
<p class="text-gray-50 font-semibold ml-2.5 mt-8">sign up for offers and more</p>
<div class="flex ml-2.5">
<input type="email" placeholder="Enter your email here" class="px-2 border-gray-50 focus:ring focus:ring-lilac-200 focus:ring-opacity-50">
<button class="py-2" style="background-color: #5D5D94;">
<svg class="fill-current w-6 h-4 mx-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 0L6.59 1.41L12.17 7H0V9H12.17L6.59 14.59L8 16L16 8L8 0Z" fill="white"/></svg>
</button>
<div>
<form action="{{ route('email-subs') }}" method="post" class="flex ml-2.5">
@csrf
<input type="email" placeholder="Enter your email here" class="px-2 border-gray-50 focus:ring focus:ring-lilac-200 focus:ring-opacity-50" name="email">
<button class="py-2 hover:bg-lilac-100 transition duration-500 bg-gray-50">
<svg class="fill-current w-6 h-4 mx-2 hover:bg-lilac-100 transition duration-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 0L6.59 1.41L12.17 7H0V9H12.17L6.59 14.59L8 16L16 8L8 0Z" fill="white"/></svg>
</button>
</form>
</div>
</div>
<div class="mb-5 ml-10 pl-10">
Expand Down
8 changes: 4 additions & 4 deletions resources/views/find-vehicles.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<form action="" method="post" class="px-20 mt-8">
<x-label for="pickup" value="Pick up" class="block font-bold text-base mt-6"/>
<div class="date-time flex">
<x-input id="pickup-date" class="block basis-8/12" type="date" name="pickup-time" value="" required />
<x-input id="pickup-time" class="block basis-4/12 ml-4" type="time" name="pickup-date" value="" required />
<x-input id="pickup-date" class="block basis-8/12" type="date" name="pickup-time" value="{{ date('Y-m-d') }}" required />
<x-input id="pickup-time" class="block basis-4/12 ml-4" type="time" name="pickup-date" value="{{ explode(' ', gmdate('Y-m-d h:i \G\M\T'))[1] }}" required />
</div>
<x-label for="dropoff" value="Drop off" class="block font-bold text-base mt-6"/>
<div class="date-time flex">
<x-input id="dropoff-date" class="block basis-8/12" type="date" name="dropoff-time" value="" required />
<x-input id="dropoff-time" class="block basis-4/12 ml-4" type="time" name="dropoff-date" value="" required />
<x-input id="dropoff-date" class="block basis-8/12" type="date" name="dropoff-time" value="{{ date('Y-m-d', strtotime('tomorrow')) }}" required />
<x-input id="dropoff-time" class="block basis-4/12 ml-4" type="time" name="dropoff-date" value="{{ explode(' ', gmdate('Y-m-d h:i \G\M\T'))[1] }}" required />
</div>
<div class="mt-6 flex justify-center">
<x-button filled="true">Rent Now</x-button>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/rent-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
<div class="date-time flex">
<div class="date basis-6/12">
<x-label for="pickup-date" value="Pick Up Date" class="block font-bold text-base pt-4"/>
<x-input id="pickup-date" class="block" type="date" name="pickup-time" value="" required />
<x-input id="pickup-date" class="block" type="date" name="pickup-date" value="{{ date('Y-m-d') }}" required />
</div>
<div class="time basis-3/12 ml-8">
<x-label for="pickup-time" value="Pick Up Time" class="block font-bold text-base pt-4"/>
<x-input id="pickup-time" class="block" type="time" name="pickup-date" value="" required />
<x-input id="pickup-time" class="block" type="time" name="pickup-time" value="{{ explode(' ', gmdate('Y-m-d h:i \G\M\T'))[1] }}" required />
</div>
</div>
<x-label for="pickup-location" value="Pickup Location" class="block font-bold text-base pt-4"/>
Expand Down Expand Up @@ -73,11 +73,11 @@
<div class="date-time flex">
<div class="date basis-6/12">
<x-label for="dropoff-date" value="Pick Up Date" class="block font-bold text-base pt-4"/>
<x-input id="dropoff-date" class="block" type="date" name="dropoff-time" value="" required />
<x-input id="dropoff-date" class="block" type="date" name="dropoff-date" value="{{ date('Y-m-d', strtotime('tomorrow')) }}" required />
</div>
<div class="time basis-3/12 ml-8">
<x-label for="dropoff-time" value="Pick Up Time" class="block font-bold text-base pt-4"/>
<x-input id="dropoff-time" class="block" type="time" name="dropoff-date" value="" required />
<x-input id="dropoff-time" class="block" type="time" name="dropoff-time" value="{{ explode(' ', gmdate('Y-m-d h:i \G\M\T'))[1] }}" required />
</div>
</div>
<x-label for="dropoff-location" value="Drop off Location" class="block font-bold text-base pt-4"/>
Expand Down
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

Route::get('/about', [BasicViewController::class, 'about']);

Route::post('/subscribe', [BasicViewController::class, 'subscribe'])->name('email-subs');

Route::get('/rent/cars', [RentController::class, 'findVehicleForm']);

Route::middleware(['auth', 'verified'])-> group(function () {
Expand Down

0 comments on commit 1948c5f

Please sign in to comment.