Skip to content

Commit b5c39eb

Browse files
committed
Shipping address files
1 parent 34949af commit b5c39eb

File tree

4 files changed

+310
-0
lines changed

4 files changed

+310
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
use Illuminate\Support\Facades\Auth;
7+
use App\address;
8+
9+
class CheckoutController extends Controller {
10+
11+
public function index() {
12+
// check for user login
13+
if (Auth::check()) {
14+
return view('front.checkout');
15+
} else {
16+
return redirect('login');
17+
}
18+
}
19+
20+
public function formvalidate(Request $request) {
21+
$this->validate($request, [
22+
'fullname' => 'required|min:5|max:35',
23+
'pincode' => 'required|numeric',
24+
'city' => 'required|min:5|max:25',
25+
'state' => 'required|min:5|max:25',
26+
'country' => 'required']);
27+
28+
$userid = Auth::user()->id;
29+
30+
$address = new address;
31+
$address->fullname = $request->fullname;
32+
$address->state = $request->state;
33+
$address->city = $request->city;
34+
$address->country = $request->country;
35+
36+
$address->user_id = $userid;
37+
$address->pincode = $request->pincode;
38+
$address->save();
39+
dd('done');
40+
}
41+
42+
}

EasyShop/app/address.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class address extends Model
8+
{
9+
protected $table = 'address';
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
use App\address;
7+
class CraeteAddressTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('address', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->string('fullname');
19+
$table->string('state');
20+
$table->string('city');
21+
$table->string('country');
22+
$table->string('pincode');
23+
24+
$table->timestamps();
25+
});
26+
}
27+
28+
/**
29+
* Reverse the migrations.
30+
*
31+
* @return void
32+
*/
33+
public function down()
34+
{
35+
Schema::drop('address');
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
@extends('front.master')
2+
3+
@section('content')
4+
5+
<section id="cart_items">
6+
<div class="container">
7+
<div class="breadcrumbs">
8+
<ol class="breadcrumb">
9+
<li><a href="#">Home</a></li>
10+
<li class="active">Check out</li>
11+
</ol>
12+
</div><!--/breadcrums-->
13+
14+
<div class="step-one">
15+
<h2 class="heading">Step1</h2>
16+
</div>
17+
18+
19+
20+
21+
<?php // form start here?>
22+
<form action="{{url('/')}}/formvalidate" method="post">
23+
<input type="hidden" name="_token" value="{{ csrf_token() }}">
24+
<div class="shopper-informations">
25+
<div class="row">
26+
<div class="col-sm-8">
27+
<div class="shopper-info">
28+
<p>Shopper Information</p>
29+
30+
<input type="text" name="fullname" placeholder="Display Name" class="form-control" value="{{ old('fullname') }}">
31+
32+
<span style="color:red">{{ $errors->first('fullname') }}</span>
33+
<hr>
34+
35+
<input type="text" placeholder="State Name" name="state" class="form-control" value="{{ old('state') }}">
36+
37+
<span style="color:red">{{ $errors->first('state') }}</span>
38+
39+
<hr>
40+
<input type="text" placeholder="Pincode" name="pincode" class="form-control" value="{{ old('pincode') }}">
41+
42+
<span style="color:red">{{ $errors->first('pincode') }}</span>
43+
44+
<hr>
45+
<input type="text" placeholder="City Name" name="city" class="form-control" value="{{ old('city') }}">
46+
47+
<span style="color:red">{{ $errors->first('city') }}</span>
48+
49+
<hr>
50+
51+
<select name="country" class="form-control" >
52+
<option value="{{ old('country') }}" selected="selected">Select country</option>
53+
<option value="United States">United States</option>
54+
<option value="Bangladesh">Bangladesh</option>
55+
<option value="UK">UK</option>
56+
<option value="India">India</option>
57+
<option value="Pakistan">Pakistan</option>
58+
<option value="Ucrane">Ucrane</option>
59+
<option value="Canada">Canada</option>
60+
<option value="Dubai">Dubai</option>
61+
</select>
62+
<span style="color:red">{{ $errors->first('country') }}</span>
63+
64+
65+
66+
67+
<?php /* <a class="btn btn-primary" href="">Get Quotes</a>
68+
<a class="btn btn-primary" href="">Continue</a>
69+
* */ ?>
70+
<br/>
71+
<div align="right"> <input type="submit" value="Continue"></div>
72+
</div>
73+
</div>
74+
75+
<div class="col-sm-4">
76+
<div class="order-message">
77+
<p>Shipping Order</p>
78+
<textarea name="message" placeholder="Notes about your order, Special Notes for Delivery" rows="16"></textarea>
79+
<label><input type="checkbox"> Shipping to bill address</label>
80+
</div>
81+
</div>
82+
</div>
83+
</div>
84+
</form>
85+
<?php // form end here?>
86+
87+
<div class="review-payment">
88+
<h2>Review & Payment</h2>
89+
</div>
90+
91+
<div class="table-responsive cart_info">
92+
<table class="table table-condensed">
93+
<thead>
94+
<tr class="cart_menu">
95+
<td class="image">Item</td>
96+
<td class="description"></td>
97+
<td class="price">Price</td>
98+
<td class="quantity">Quantity</td>
99+
<td class="total">Total</td>
100+
<td></td>
101+
</tr>
102+
</thead>
103+
<tbody>
104+
<tr>
105+
<td class="cart_product">
106+
<a href=""><img src="images/cart/one.png" alt=""></a>
107+
</td>
108+
<td class="cart_description">
109+
<h4><a href="">Colorblock Scuba</a></h4>
110+
<p>Web ID: 1089772</p>
111+
</td>
112+
<td class="cart_price">
113+
<p>$59</p>
114+
</td>
115+
<td class="cart_quantity">
116+
<div class="cart_quantity_button">
117+
<a class="cart_quantity_up" href=""> + </a>
118+
<input class="cart_quantity_input" type="text" name="quantity" value="1" autocomplete="off" size="2">
119+
<a class="cart_quantity_down" href=""> - </a>
120+
</div>
121+
</td>
122+
<td class="cart_total">
123+
<p class="cart_total_price">$59</p>
124+
</td>
125+
<td class="cart_delete">
126+
<a class="cart_quantity_delete" href=""><i class="fa fa-times"></i></a>
127+
</td>
128+
</tr>
129+
130+
<tr>
131+
<td class="cart_product">
132+
<a href=""><img src="images/cart/two.png" alt=""></a>
133+
</td>
134+
<td class="cart_description">
135+
<h4><a href="">Colorblock Scuba</a></h4>
136+
<p>Web ID: 1089772</p>
137+
</td>
138+
<td class="cart_price">
139+
<p>$59</p>
140+
</td>
141+
<td class="cart_quantity">
142+
<div class="cart_quantity_button">
143+
<a class="cart_quantity_up" href=""> + </a>
144+
<input class="cart_quantity_input" type="text" name="quantity" value="1" autocomplete="off" size="2">
145+
<a class="cart_quantity_down" href=""> - </a>
146+
</div>
147+
</td>
148+
<td class="cart_total">
149+
<p class="cart_total_price">$59</p>
150+
</td>
151+
<td class="cart_delete">
152+
<a class="cart_quantity_delete" href=""><i class="fa fa-times"></i></a>
153+
</td>
154+
</tr>
155+
<tr>
156+
<td class="cart_product">
157+
<a href=""><img src="images/cart/three.png" alt=""></a>
158+
</td>
159+
<td class="cart_description">
160+
<h4><a href="">Colorblock Scuba</a></h4>
161+
<p>Web ID: 1089772</p>
162+
</td>
163+
<td class="cart_price">
164+
<p>$59</p>
165+
</td>
166+
<td class="cart_quantity">
167+
<div class="cart_quantity_button">
168+
<a class="cart_quantity_up" href=""> + </a>
169+
<input class="cart_quantity_input" type="text" name="quantity" value="1" autocomplete="off" size="2">
170+
<a class="cart_quantity_down" href=""> - </a>
171+
</div>
172+
</td>
173+
<td class="cart_total">
174+
<p class="cart_total_price">$59</p>
175+
</td>
176+
<td class="cart_delete">
177+
<a class="cart_quantity_delete" href=""><i class="fa fa-times"></i></a>
178+
</td>
179+
</tr>
180+
<tr>
181+
<td colspan="4">&nbsp;</td>
182+
<td colspan="2">
183+
<table class="table table-condensed total-result">
184+
<tr>
185+
<td>Cart Sub Total</td>
186+
<td>$59</td>
187+
</tr>
188+
<tr>
189+
<td>Exo Tax</td>
190+
<td>$2</td>
191+
</tr>
192+
<tr class="shipping-cost">
193+
<td>Shipping Cost</td>
194+
<td>Free</td>
195+
</tr>
196+
<tr>
197+
<td>Total</td>
198+
<td><span>$61</span></td>
199+
</tr>
200+
</table>
201+
</td>
202+
</tr>
203+
</tbody>
204+
</table>
205+
</div>
206+
<div class="payment-options">
207+
<span>
208+
<label><input type="checkbox"> Direct Bank Transfer</label>
209+
</span>
210+
<span>
211+
<label><input type="checkbox"> Check Payment</label>
212+
</span>
213+
<span>
214+
<label><input type="checkbox"> Paypal</label>
215+
</span>
216+
</div>
217+
</div>
218+
</section> <!--/#cart_items-->
219+
220+
221+
@endsection

0 commit comments

Comments
 (0)