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

Commit

Permalink
add lading page
Browse files Browse the repository at this point in the history
  • Loading branch information
alyafitrin committed May 13, 2022
2 parents cf1d000 + d3700bd commit 2008aef
Show file tree
Hide file tree
Showing 29 changed files with 494 additions and 44 deletions.
23 changes: 23 additions & 0 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AdminController extends Controller
{
public function getCustomersDashboard()
{
return view('dashboard.customers');
}

public function getVehiclesDashboard()
{
return view('dashboard.vehicles');
}

public function getOrdersDashboard()
{
return view('dashboard.orders');
}
}
27 changes: 16 additions & 11 deletions app/Http/Controllers/BasicViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

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

use Illuminate\Http\Request;

class BasicViewController extends Controller
{
public function index()
public function getIndex()
{
$reviews = Review::all()
->sortByDesc('created_at')
Expand All @@ -21,28 +22,32 @@ public function fallback()
abort(404);
}

public function guide()
public function getGuide()
{
return view('guide');
}

public function cars()
public function getRules()
{
return view('cars');
return view('rules');
}

public function motors()
{
return view('motors');
}

public function help()
public function getHelp()
{
return view('help');
}

public function about()
public function getAbout()
{
return view('about');
}

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

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

return redirect($redirect_url);
}
}
28 changes: 27 additions & 1 deletion app/Http/Controllers/RentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,33 @@

class RentController extends Controller
{
public function carFormView() {
public function getFindCar()
{
return view('find-vehicles');
}

public function getFindMotor()
{
return view('find-vehicles');
}

public function getRentCarForm()
{
return view('rent-form');
}

public function getRentMotorForm()
{
return view('rent-form');
}

public function getRentCars()
{
return view('vehicles-list');
}

public function getRentMotors()
{
return view('vehicles-list');
}
}
18 changes: 18 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UserController extends Controller
{
public function getUserProfile()
{
return view('user-profile');
}

public function getUserOrders()
{
return view('order-history');
}
}
11 changes: 11 additions & 0 deletions app/Models/Order.php
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 Order extends Model
{
use HasFactory;
}
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: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens, HasFactory, Notifiable;

Expand Down
4 changes: 3 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function register()
*/
public function boot()
{
//
if($this->app->environment('production')) {
\URL::forceScheme('https');
}
}
}
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
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
|
*/

'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'pgsql'),

/*
|--------------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions config/midtrans.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'mercant_id' => env('MIDTRANS_MERCHAT_ID'),
'client_key' => env('MIDTRANS_CLIENT_KEY'),
'server_key' => env('MIDTRANS_SERVER_KEY'),

'is_production' => false,
'is_sanitized' => false,
'is_3ds' => false,
];
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');
}
};
54 changes: 54 additions & 0 deletions database/migrations/2022_05_12_130154_create_orders_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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('orders', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->references('id')->on('users');
$table->unsignedBigInteger('vehicle_id')->references('id')->on('vehicles');
$table->string('phone_1');
$table->string('phone_2');
$table->string('address_id');
$table->string('address_mlg');
$table->time('pickup_time');
$table->date('pickup_date');
$table->string('pickup_address');
$table->time('dropoff_time');
$table->date('dropoff_date');
$table->string('dropoff_address');
$table->string('id_card');
$table->string('id_card_2');
$table->string('driver_license');
$table->float('total_price', 10, 2);
$table->string('note');
$table->enum('order_status', ['PENDING', 'REJECTED', 'WAITING_FOR_PAYMENT', 'PAYMENT_DONE', 'CANCELED', 'COMPLETED']);
$table->string('payment_method')->nullable();
$table->string('transaction_id')->nullable();
$table->string('virtual_account')->nullable();
$table->string('qr_link')->nullable();
$table->string('deep_link')->nullable();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('orders');
}
};
38 changes: 38 additions & 0 deletions database/migrations/2022_05_13_062551_update_users_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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::table('users', function (Blueprint $table) {
$table->string('phone_1');
$table->string('phone_2');
$table->string('address_id');
$table->string('address_mlg');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('phone_1');
$table->dropColumn('phone_2');
$table->dropColumn('address_id');
$table->dropColumn('address_mlg');
});
}
};
28 changes: 28 additions & 0 deletions database/seeders/BrandSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class BrandSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = [
[ 'name' => 'Honda' ],
[ 'name' => 'Suzuki' ],
[ 'name' => 'Toyota' ],
[ 'name' => 'Yamaha' ],
[ 'name' => 'Daihatsu' ],
[ 'name' => 'Nissan' ]
];

\DB::table('brands')->insert($data);
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
"production": "mix --production",
"postinstall": "npm run prod"
},
"devDependencies": {
"@tailwindcss/forms": "^0.4.0",
Expand Down
Loading

0 comments on commit 2008aef

Please sign in to comment.