merged conflict

This commit is contained in:
Zain Fauzan Rofie Azizi
2018-06-28 17:11:56 +08:00
37 changed files with 7961 additions and 255 deletions
+7 -1
View File
@@ -7,11 +7,17 @@ use Illuminate\Database\Eloquent\Model;
class Company extends Model
{
//
protected $fillable = ['company_profile', 'reg_cert', 'company_name', 'registration_no', 'tax_no', 'tel_no', 'fax', 'address', 'city', 'postcode', 'state', 'country', 'contact_person'];
protected $fillable = ['user_id', 'company_profile', 'reg_cert', 'company_name', 'registration_no', 'tax_no', 'tel_no', 'fax', 'address', 'city', 'postcode', 'state', 'country', 'contact_person'];
//protected $guarded = [];
public function user()
{
return $this->belongsTo('App\User');
}
public function deliveryinfo() {
return $this->hasMany('App\Deliveryinfo');
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ class Decisionitem extends Model
protected $fillable = [
'id',
'decision_id',
'wi_id',
'warehouseitem_id',
'num_of_item',
];
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Deliveryinfo extends Model
{
protected $fillable = [
'id',
'branch',
'deli_info',
'address',
'city',
'postcode',
'state',
'country',
'contact_person',
'contact_person_no',
'com_id'
];
public function company() {
return $this->belongsTo('App\Company');
}
}
+25 -19
View File
@@ -7,6 +7,7 @@ use App\PasswordResets;
use JWTAuth;
use Auth;
use App\Role;
use App\Company;
use Aloha\Twilio\Twilio;
use Tymon\JWTAuth\Exceptions\JWTException;
@@ -30,10 +31,14 @@ class AuthController extends Controller
public function sendVerification(Request $request){
$credentials = $request->only('phone');
$rules = [
'phone' => 'required|digits:10|unique:users'
'phone' => 'required|digits_between:10,11|unique:users'
];
$validator = Validator::make($credentials, $rules);
if($validator->fails()){
return response()->json(['success'=> false, 'message'=> 'The minimum length should be 10.' ], 400);
}
// create user if not exist
$user = User::firstOrNew([
'phone' => $request->phone
@@ -41,24 +46,24 @@ class AuthController extends Controller
$user->save();
// create token if not exist, update if exist
$token = mt_rand(0000,9999);
$token = mt_rand(0000,9999);
// for testing
// for testing
if($request->phone == '0123456789'){
$token = "1234";
}
$user_verification = $user->phoneVerification()->firstOrNew([
'user_id' => $user->id,
]);
$user_verification->token = $token;
$user_verification->save();
// TODO: send token to phone
// TODO: send token to phone
//$message = "RM0.00 IZYIM: Verification code : ". $token;
//$twilio = new Twilio(env('TWILIO_ACC'), env('TWILIO_TOKEN'), env('TWILIO_NUMBER'));
//$twilio->message($request->phone, $message);
return response()->json(['success'=> true, 'message'=> 'A verification code has been send to your mobile number.' ]);
return response()->json(['success'=> true, 'message'=> 'A verification code has been send to your mobile number.' ], 200);
}
@@ -79,14 +84,14 @@ class AuthController extends Controller
return response()->json([
'success'=> true,
'message'=> 'Account already verified.'
]);
], 200);
}
}
else{
return response()->json([
'success'=> false,
'message'=> 'Please contact support.'
]);
], 400);
}
// check and verify valid token
@@ -100,16 +105,16 @@ class AuthController extends Controller
return response()->json(['error' => 'invalid_credentials'], 401);
}
// TODO : Create company for user
// TODO : Create company for user
$expiration = JWTAuth::setToken($userToken)->getPayload()->get('exp');
// all good so return the token
return response()->json(['success' => true, 'token' => $userToken,
'token_type' => 'bearer',
'expires_in' => $expiration - time()]);
}
return response()->json(['success'=> false, 'error'=> "Verification code is invalid."]);
return response()->json(['success'=> false, 'error'=> "Verification code is invalid."], 400);
}
/**
@@ -130,9 +135,9 @@ class AuthController extends Controller
$validator = Validator::make($credentials, $rules);
if($validator->fails()) {
return response()->json(['success'=> false, 'error'=> $validator->messages()]);
return response()->json(['success'=> false, 'error'=> $validator->messages()], 400);
}
$name = $request->name;
$password = $request->password;
$role = $request->role;
@@ -146,12 +151,13 @@ class AuthController extends Controller
$user->attachRole($role);
$user->update(['name' => $name, 'password' => Hash::make($password)]);
// TODO : create company for user
$company = new Company;
$company->user = $user;
// TODO : create company for user
$company = new Company;
$company->user_id = $user->id;
$company->save();
return response()->json(['success'=> true, 'message'=> 'Profile updated.']);
return response()->json(['success'=> true, 'message'=> 'Profile updated.'], 200);
}
@@ -179,7 +185,7 @@ class AuthController extends Controller
try {
// attempt to verify the credentials and create a token for the user
if (! $token = JWTAuth::attempt($credentials)) {
return response()->json(['success' => false, 'error' => 'We cant find an account with this credentials. Please make sure you entered the right information and you have verified your email address.'], 401);
return response()->json(['success' => false, 'error' => 'Phone or password incorrect'], 401);
}
} catch (JWTException $e) {
// something went wrong whilst attempting to encode the token
+29 -9
View File
@@ -15,9 +15,30 @@ class CompanyController extends Controller
$company = Company::where("user_id", Auth::user()->id)->first();
if (!$company)
{
return response()->json(['message'=>'company not found'], 404);
return response()->json(['success'=> false, 'message'=>'Company not found'], 404);
}
$rules = [
'company_name' => 'required',
'registration_no' => 'required',
'tax_no' => 'required',
'tax_no' => 'required',
'tel_no' => 'required',
'fax' => 'required',
'address' => 'required',
'city' => 'required',
'postcode' => 'required',
'state' => 'required',
'country' => 'required',
'contact_person' => 'required'
];
$validator = Validator::make($request->all(), $rules);
if($validator->fails()) {
return response()->json(['success'=> false, 'error'=> 'All the fields are required'], 400);
//return response()->json(['success'=> false, 'error'=> $validator->messages()], 400);
}
$company->company_name=$request->input('company_name');
$company->registration_no=$request->input('registration_no');
$company->tax_no=$request->input('tax_no');
@@ -30,8 +51,7 @@ class CompanyController extends Controller
$company->country=$request->input('country');
$company->contact_person=$request->input('contact_person');
$company->save();
return response()->json(['company'=>$company],200);
return response()->json(['success'=> true, 'message'=>'Company created successfully'],200);
}
public function companyProfile(Request $request)
@@ -39,7 +59,7 @@ class CompanyController extends Controller
$company = Company::where("user_id", Auth::user()->id)->first();
if (!$company)
{
return response()->json(['message'=>'company for company_prof not found'],200);
return response()->json(['success'=> false, 'error'=>'Company not found'], 404);
}
//validaating file types
$validator = Validator::make($request->all(), [
@@ -47,7 +67,7 @@ class CompanyController extends Controller
]);
if($validator->fails())
{
return response()->json(['message'=>'Incorrect format'],200);
return response()->json(['success'=> false, 'error'=>'Incorrect format'], 400);
}
if($file = $request->file('company_profile')) //company profile picture
@@ -65,7 +85,7 @@ class CompanyController extends Controller
$company->company_profile = $unique_name. '.' .$ext; //update database
} //end if
$company->save();
return response()->json(['company'=>$company],200);
return response()->json(['success'=> true, 'message'=>'Company profile picture uploaded successfully'],200);
}//end of companyProfile()
public function regCert(Request $request)
@@ -73,7 +93,7 @@ class CompanyController extends Controller
$company = Company::where("user_id", Auth::user()->id)->first();
if (!$company)
{
return response()->json(['message'=>'Company not found'], 404);
return response()->json(['success'=> false, 'error'=>'Company not found'], 404);
}
//validating file types
@@ -81,7 +101,7 @@ class CompanyController extends Controller
'reg_cert' => 'mimes:jpg,jpeg,bmp,png,gif,svg,pdf'
]);
if($validator->fails()){
return response()->json(['message'=>'Incorrect format'],200);
return response()->json(['success'=> false, 'error'=>'Incorrect format'], 400);
}
if($request->hasFile('reg_cert')) //Registration Certificate upload
@@ -99,7 +119,7 @@ class CompanyController extends Controller
$company->reg_cert = $unique_name. '.' .$ext; //this updates database
}//end if
$company->save();
return response()->json(['company'=>$company],200);
return response()->json(['success'=> true, 'message'=>'Registration Certificate uploaded successfully'], 200);
}//end regCert()
}//end of class
@@ -0,0 +1,106 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Deliveryinfo;
use Auth;
class DeliveryinfoController extends Controller
{
public function index()
{
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->get();
return response()->json($deliveryinfo, 200);
}
/**
* Display the specified delivery-info.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Deliveryinfo $id)
{
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail();
return response()->json($deliveryinfo, 200);
}
/**
* Store a newly delivery-info in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$user = Auth::user();
$deliveryinfo = new Deliveryinfo;
$deliveryinfo->branch = $request->input('branch');
$deliveryinfo->deli_info = $request->input('deli_info');
$deliveryinfo->address = $request->input('address');
$deliveryinfo->city = $request->input('city');
$deliveryinfo->postcode = $request->input('postcode');
$deliveryinfo->state = $request->input('state');
$deliveryinfo->country = $request->input('country');
$deliveryinfo->contact_person = $request->input('contact_person');
$deliveryinfo->contact_person_no = $request->input('contact_person_no');
$deliveryinfo->com_id = $user->company();
$deliveryinfo->save();
return response()->json(['deliveryinfo'=>$deliveryinfo],201);
}
/**
* Update the delivery-info.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail();
if (!$deliveryinfo)
{
return response()->json(['message'=>'Access Denied!'], 404);
}
$deliveryinfo->branch = $request->input('branch');
$deliveryinfo->deli_info = $request->input('deli_info');
$deliveryinfo->address = $request->input('address');
$deliveryinfo->city = $request->input('city');
$deliveryinfo->postcode = $request->input('postcode');
$deliveryinfo->state = $request->input('state');
$deliveryinfo->country = $request->input('country');
$deliveryinfo->contact_person = $request->input('contact_person');
$deliveryinfo->contact_person_no = $request->input('contact_person_no');
$deliveryinfo->com_id = $user->company();
$deliveryinfo->save();
return response()->json(['deliveryinfo'=>$deliveryinfo],200);
}
/**
* Remove the delivery-info.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Deliveryinfo $id)
{
$deliveryinfo = Deliveryinfo::where('com_id', Auth::user()->company())->where('id', $id)->firstOrFail();
if (!$deliveryinfo)
{
return response()->json(['message'=>'Access Denied!'], 404);
}
$deliveryinfo->delete($id);
return response()->json($deliveryinfo, 204);
}
}
+2 -12
View File
@@ -8,24 +8,14 @@ use App\Soitem;
class SoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
// get the list of the shipping order
public function index()
{
return view('welcome');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
//get the shipping order
public function showso($so_id)
public function show($so_id)
{
$so_id = So::find($so_id);
return response()->json($so_id, 200);
@@ -269,7 +269,7 @@ class WarehousearrangementController extends Controller
//decision-type
$decisionitem = new Decisionitem;
$decisionitem->decision_id = $decision->id;
$decisionitem->wi_id = $warehouseitems->id;
$decisionitem->warehouseitem_id = $warehouseitems->id;
$decisionitem->num_of_item = $request->input('num_of_item');
$decisionitem->save();
+15
View File
@@ -53,6 +53,21 @@ return [
'strict' => true,
'engine' => null,
],
'testing' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'testingizyim',
'username' => 'root',
'password' => '',
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'testing' => [
'driver' => 'mysql',
+3
View File
@@ -15,6 +15,9 @@ use Faker\Generator as Faker;
$factory->define(App\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => bcrypt(str_random(10)), // secret
'phone' => $faker->unique()->randomDigit,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
@@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDeliveryinfosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('deliveryinfos', function (Blueprint $table) {
$table->increments('id');
$table->string('branch');
$table->string('deli_info');
$table->string('address');
$table->string('city');
$table->integer('postcode');
$table->string('state');
$table->string('country');
$table->string('contact_person');
$table->integer('contact_person_no');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('deliveryinfos');
}
}
@@ -25,6 +25,6 @@ class ChangeEmailToMobileFromUser extends Migration
*/
public function down()
{
$table->renameColumn('phone', 'email');
//$table->renameColumn('phone', 'email');
}
}
@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddColumnToTableDeliveryInfo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('deliveryinfos', function (Blueprint $table) {
$table->unsignedInteger('com_id');//FK wrn id
$table->foreign('com_id')
->references('id')->on('companies')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('deliveryinfos', function (Blueprint $table) {
//
});
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameWiIdToWarehouseitemIdToDecisonitemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('decisionitems', function (Blueprint $table) {
$table->renameColumn('wi_id', 'warehouseitem_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('decisionitems', function (Blueprint $table) {
$table->renameColumn('warehouseitem_id', 'wi_id');
});
}
}
+35
View File
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class CompanySeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('companies')->insert([
'id' => '999',
'company_name'=>'testing',
'registration_no'=>'testing',
'tax_no'=>'testing',
'tel_no'=>'12345',
'fax'=>'12345',
'address'=>'testing',
'city'=>'testing',
'postcode'=>'12345',
'state'=>'testing',
'country'=>'testing',
'contact_person'=>'testing',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
'user_id' => '2'
]);
}
}
+2
View File
@@ -17,5 +17,7 @@ class DatabaseSeeder extends Seeder
$this->call(SoitemSeeder::class);
$this->call(WarehousearrSeeder::class);
$this->call(WarehouseitemSeeder::class);
$this->call(DeliveryInfoSeeder::class);
$this->call(CompanySeeder::class);
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class DeliveryInfoSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('deliveryinfos')->insert([
'id' => '999',
'branch' => 'Testing',
'deli_info' => 'Testing',
'address' => 'Testing',
'city' => 'Test',
'postcode' => '12345',
'state' => 'Testing',
'country' => 'Testing',
'contact_person' => 'Testing',
'contact_person_no' => '12345',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
'com_id' => '999'
]);
}
}
+6963
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -28,6 +28,9 @@
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="DB_CONNECTION" value="testing"/>
<<<<<<< HEAD
<env name="MAIL_DRIVER" value="array"/>
=======
>>>>>>> 49abcb49236cdde1e1fa759f89a704688447c106
</php>
</phpunit>
+96 -12
View File
@@ -3,6 +3,7 @@
<title>AzureUI - Term</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/global.style.css" />
@@ -10,6 +11,7 @@
.header {
width:relative;
margin: 0 auto;
height: 30px;
}
#backbtn {
@@ -41,6 +43,7 @@
<div class="container">
<main class="fix-top-menu">
<section class="container">
<!--company profile
<form>
<div class="form-row txt-center">
<div class="profile-image">
@@ -53,21 +56,40 @@
</div>
</div>
</div>
</form>
-->
<br>
<form>
<div class="form-row txt-center">
<b>Please upload the registration certificate.</b>
<label class="update-btn fix">
<input id="reg_cert" type="file" style="display:none" /> Please upload the registration certificate
<div class="form-row txt-center">
<input id="reg_cert" type="file" />
<div class="form-divider"></div>
<a href="#" id="regCert" style="width:50%; margin-left:25%;" class="button block green">Upload</a>
</div>
</label>
</div>
<br>
<div class="form-label-divider">
<span class="label-span">Company Information</span>
</div>
<div class="form-divider"></div>
</form>
<div class="form-divider"></div>
<div class="form-divider"></div>
<div class="alert alert-danger" id="alert" role="alert" style="display: none"></div>
<div class="alert alert-success" id="alert1" role="alert1" style="display: none"></div>
<br>
<div class="form-label-divider">
<span class="label-span">Company Information</span>
</div>
<div class="form-divider"></div>
<div class="alert alert-danger" id="alert2" role="alert2" style="display: none"></div>
<form>
<div class="form-row-group">
<div class="form-row no-padding">
<input id="company-name" type="text" class="form-element" placeholder="Company Name" required />
@@ -102,20 +124,82 @@
<div class="form-row no-padding">
<input id="contact-person" type="text" class="form-element" placeholder="Contact Person" required />
</div>
<div class="form-row no-padding">
<input id="contact-person-no" type="text" class="form-element" placeholder="Contact Person No" required />
</div>
</div>
<div class="form-divider"></div>
<div class="form-row txt-center">
<a href="#" style="width:50%; margin-left:25%;" class="button block green">Edit</a>
</div>
<a href="#" id="companyDetails" style="width:50%; margin-left:25%;" class="button block green">Submit</a>
</div>
</form>
</section>
</main>
</div>
<!-- Main Content End Here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#regCert').click(function() {
var fd = new FormData();
var files = $('#reg_cert')[0].files[0];
fd.append('reg_cert',files);
$.ajax({
type: "POST",
url: "api/company/reg_cert/",
headers: {"Authorization": 'Bearer' + localStorage.getItem('token')},
data:fd,
contentType: false,
cache: false,
processData: false,
success: function(data) {
document.getElementById("alert").style.display = "none";
console.log(data.message);
$('#alert1').html(data.message);
$('#alert1').show();
},
error: function(data) {
console.log(data);
document.getElementById("alert1").style.display = "none";
$('#alert').html(data.responseJSON.error);
$('#alert').show();
}
});
})
$('#companyDetails').click(function() {
$.ajax({
type: "PATCH",
url: "api/company",
headers: {"Authorization": 'Bearer' + localStorage.getItem('token')},
data: {
company_name: $('#company-name').val(),
registration_no: $('#registration-no').val(),
tax_no: $('#tax-no').val(),
tel_no: $('#tel-no').val(),
fax: $('#fax').val(),
address: $('#address').val(),
city: $('#city').val(),
postcode: $('#postcode').val(),
state: $('#state').val(),
country: $('#country').val(),
contact_person: $('#contact-person').val()
},
success: function(data) {
//alert("success");
document.location.href="home.html";
},
error: function(data) {
//console.log(data);
$('#alert2').html(data.responseJSON.error);
$('#alert2').show();
}
});
})
})
</script>
</body>
</html>
-6
View File
File diff suppressed because one or more lines are too long
+129 -56
View File
@@ -261,39 +261,37 @@
</label>
</div>
<p class="fix-name fix">Fedrick Darel Auditore</p>
<p class="fix-name fix">Asif Ferdous</p>
<p class="fix-role">Importer</p>
</div>
</div>
<div class="form-label-divider">
<div class="form-label-divider" >
<span class="label-span">Personal Information</span>
</div>
<div class="form-divider"></div>
<div class="form-row txt-center">
<div class="form-row txt-center" data-popup="formPopup23">
<a href="#" style="width:50%; margin-left:25%;" class="button block green">Edit</a>
</div>
<div class="form-divider"></div>
<div class="form-row-group">
<div class="form-row no-padding">
<label id="company-name" type="text" class="form-element">Fedrick Darel</label>
<label id="registration-no" type="text" class="form-element">Asif ferdous</label>
</div>
<div class="form-row no-padding">
<label id="registration-no" type="text" class="form-element">Auditore</label>
<label id="registration-no" type="text" class="form-element">ferdous.asif2012@gmail.com</label>
</div>
<div class="form-row no-padding">
<label id="registration-no" type="text" class="form-element">fedrickdarel@gmail.com</label>
<label id="registration-no" type="text" class="form-element">http://www.ferdous.com</label>
</div>
<div class="form-row no-padding">
<label id="registration-no" type="text" class="form-element">http://www.Azure.com</label>
</div>
<div class="form-row no-padding">
<label id="registration-no" type="text" class="form-element">Founder and CEO</label>
<label id="registration-no" type="text" class="form-element">CEO</label>
</div>
</div>
@@ -322,9 +320,9 @@
<li>
<a href="home.html"><i class="fa fa-home"></i> Home</a>
</li>
<li>
<a href="#"><i class="fa fa-bell"></i> Notice</a>
</li>
<!--<li>-->
<!--<a href="#"><i class="fa fa-bell"></i>piyal</a>-->
<!--</li>-->
<li>
<a href="javascript:void(0);"><i class="fa fa-briefcase"></i> Arrangement <span class="fa fa-angle-down"></span></a>
<ul>
@@ -339,21 +337,21 @@
<li><a href="shipping-order.html" data-loader="show"><i class="fa fa-truck"></i> Shipping Order</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-comments"></i> Messenger</a>
</li>
<!--<li>-->
<!--<a href="#"><i class="fa fa-comments"></i> Messenger</a>-->
<!--</li>-->
<li>
<a href="javascript:void(0);"><i class="fa fa-shopping-cart"></i> Track Order</a>
</li>
<li>
<a href="example-element.html"><i class="fa fa-code"></i>Example Element <span class="fa fa-angle-down"></span></a>
<ul>
<li><a href="element-wizard.html" data-loader="show"><i class="fa fa-code"></i> Wizard Element</a></li>
<li><a href="#" data-loader="show"><i class="fa fa-code"></i> Accordion Element</a></li>
<li><a href="#" data-loader="show"><i class="fa fa-code"></i> Popup Element</a></li>
<li><a href="element-MTracker.html" data-loader="show"><i class="fa fa-code"></i> Meter Tracker Element</a></li>
</ul>
</li>
<!--<li>-->
<!--<a href="example-element.html"><i class="fa fa-code"></i>Example Element <span class="fa fa-angle-down"></span></a>-->
<!--<ul>-->
<!--<li><a href="element-wizard.html" data-loader="show"><i class="fa fa-code"></i> Wizard Element</a></li>-->
<!--<li><a href="#" data-loader="show"><i class="fa fa-code"></i> Accordion Element</a></li>-->
<!--<li><a href="#" data-loader="show"><i class="fa fa-code"></i> Popup Element</a></li>-->
<!--<li><a href="element-MTracker.html" data-loader="show"><i class="fa fa-code"></i> Meter Tracker Element</a></li>-->
<!--</ul>-->
<!--</li>-->
</ul>
</div>
<!-- Menu navigation end -->
@@ -412,7 +410,7 @@
</div>
<div class="form-row txt-center">
<a href="shipping-order.html" style="width:50%; margin-left:25%;" class="button block blue">Add New SO</a>
<a href="create-shipping-order-S1.html" style="width:50%; margin-left:25%;" class="button block blue">New Shipping Order</a>
</div>
<div class="form-divider"></div>
@@ -611,7 +609,7 @@
</label>
</div>
<p class="fix-name fix">Fedrick Darel Auditore</p>
<p class="fix-name fix">Asif ferdous</p>
<p class="fix-role">Importer</p>
</div>
@@ -635,11 +633,27 @@
</a>
</div>
<div class="profile-menu-branch">
<!--<div class="profile-menu-branch">-->
<!--<a href="#">-->
<!--<img class="avatar-img" src="images/Azure-Branch-Icon.png" width="80" height="80" />-->
<!--<div>-->
<!--Branch Information-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
<div class="profile-menu-xAxisP">
<a href="#">
<img class="avatar-img" src="images/Azure-Branch-Icon.png" width="80" height="80" />
<img class="avatar-img" src="images/Azure-DeliveryIcon.png" width="80" height="80" />
<div>
Branch Information
Delivery Information
</div>
</a>
</div>
<div class="profile-menu-personal">
<a href="#">
<img class="avatar-img" src="images/Azure-Personal-Icon.png" width="80" height="80" />
<div>
Personal Information
</div>
</a>
</div>
@@ -655,27 +669,27 @@
<div class="profile-menu">
<!-- Deliver Profile Start Here -->
<div class="profile-menu-xAxisP">
<a href="#">
<img class="avatar-img" src="images/Azure-DeliveryIcon.png" width="80" height="80" />
<div>
Delivery Information
</div>
</a>
</div>
<!--<div class="profile-menu-xAxisP">-->
<!--<a href="#">-->
<!--<img class="avatar-img" src="images/Azure-DeliveryIcon.png" width="80" height="80" />-->
<!--<div>-->
<!--Delivery Information-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
<!-- Delivery Profile End Here-->
<div class="profile-menu-divider"></div>
<!--<div class="profile-menu-divider"></div>-->
<!-- Branch Profile Start Herer -->
<div class="profile-menu-xAxisM">
<a href="#">
<img class="avatar-img" src="images/Azure-Staff-Icon.png" width="80" height="80" />
<div>
Staff<br />Information
</div>
</a>
</div>
<!--&lt;!&ndash; Branch Profile Start Herer &ndash;&gt;-->
<!--<div class="profile-menu-xAxisM">-->
<!--<a href="#">-->
<!--<img class="avatar-img" src="images/Azure-Staff-Icon.png" width="80" height="80" />-->
<!--<div>-->
<!--Staff<br />Information-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
<!-- Branch Profile End Here -->
</div>
@@ -686,14 +700,14 @@
<!-- Staff Profile Start Here -->
<div class="form-row txt-center">
<div class="profile-menu">
<div class="profile-menu-personal">
<a href="#">
<img class="avatar-img" src="images/Azure-Personal-Icon.png" width="80" height="80" />
<div>
Personal Information
</div>
</a>
</div>
<!--<div class="profile-menu-personal">-->
<!--<a href="#">-->
<!--<img class="avatar-img" src="images/Azure-Personal-Icon.png" width="80" height="80" />-->
<!--<div>-->
<!--Personal Information-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
</div>
</div>
@@ -710,6 +724,65 @@
</div>
<!--POPUP HTML CONTENT START -->
<div class="popup-overlay" id="formPopup23">
<!-- if you dont want overlay add class .no-overlay -->
<div class="popup-container">
<div class="popup-header">
<h3 class="popup-title">Personal Information</h3>
<span class="popup-close" data-dismiss="true"><i class="fa fa-times"></i></span>
</div>
<div class="popup-content">
<div class="form-row-group with-icons-no-padding">
<div class="form-row no-padding">
<div class="form-element-title">
<label style="color: #000">Full Name</label>
</div>
<input type="text" class="form-element" placeholder="Asif Ferdous" required />
</div>
<div class="form-row no-padding">
<div class="form-element-title">
<label style="color: #000">Email</label>
</div>
<input type="text" class="form-element" placeholder="ferdous.asif2012@gmail.com" required />
</div>
<div class="form-row no-padding">
<div class="form-element-title">
<label style="color: #000">Website</label>
</div>
<input type="text" class="form-element" placeholder="http://ferdous.com" required />
</div>
<div class="form-row no-padding">
<div class="form-element-title">
<label style="color: #000">Position</label>
</div>
<input type="text" class="form-element" placeholder="CEO" required />
</div>
</div>
</div>
<div class="popup-footer">
<button class="button blue" data-dismiss="true">Save</button>
</div>
</div>
</div>
<!--personal popup -->
<div class="popup-overlay" id="formPopup">
<!-- if you dont want overlay add class .no-overlay -->
<div class="popup-container">
+11 -3
View File
@@ -4,6 +4,7 @@
<title>AzureUI - SIGNIN</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/global.style.css">
@@ -21,6 +22,9 @@
<section class="container">
<form>
@csrf
<div class="alert alert-danger" role="alert" style="display: none">
</div>
<div class="form-row-group with-icons">
<div class="form-row no-padding">
<div style="position:absolute; top: 10px;">
@@ -36,6 +40,7 @@
</div>
</div>
<div class="form-divider"></div>
<div class="form-row txt-center">
@@ -60,6 +65,8 @@
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#login').click(function() {
@@ -73,10 +80,11 @@
success: function(data) {
localStorage.token = data.data.token;
document.location.href="home.html";
alert('Got a token from the server! Token: ' + data.data.token);
},
error: function() {
alert("Login Failed");}
error: function(data) {
$('.alert').html(data.responseJSON.error);
$('.alert').show();
}
});
})
})
-1
View File
File diff suppressed because one or more lines are too long
+20 -4
View File
@@ -4,6 +4,7 @@
<title>AzureUI - Term</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/global.style.css" />
@@ -42,6 +43,10 @@
<div class="form-divider"></div>
<div class="alert alert-danger" id="alert" role="alert" style="display: none"></div>
<div class="form-divider"></div>
<div class="form-row-group with-icons-no-padding">
<div class="form-row no-padding">
<div class="form-element-title">
@@ -95,6 +100,8 @@
<script src="js/global.script.js"></script>
<!-- Require For All Pages -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#pers-info').click(function() {
@@ -109,11 +116,20 @@
password_confirmation:$('#password_confirmation').val()
},
success: function(data) {
document.location.href="index.html";
document.location.href="company-profile.html";
},
error: function() {
alert("Failed");}
})
error: function(data) {
var errors = $.parseJSON(data.responseText);
//console.log(errors.error);
if (errors != null){
for (var i in errors.error) {
//console.log(errors.error[i][0]);
$('.alert').append(errors.error[i][0] + "<br/>");
}
}
$('.alert').show();
}
})
})
});
</script>
+13 -4
View File
@@ -4,6 +4,7 @@
<title>AzureUI - Term</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/global.style.css" />
@@ -24,6 +25,9 @@
<div class="form-divider"></div>
<!--Error Alert-->
<div class="alert alert-danger" role="alert" style="display: none"></div>
<!-- Here Lies Main Start Here -->
<main>
<section class="container">
@@ -52,6 +56,8 @@
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script type="text/javascript">
function readCookie(name) {
var nameEQ = encodeURIComponent(name) + "=";
@@ -78,16 +84,19 @@
token: $('#verify-code').val()},
success: function(data) {
if( data.success){
localStorage.token = data.token;
document.location.href="profile-first-setup.html";
localStorage.token = data.data.token;
}
else{
console.log('wrong code');
//console.log('wrong code');
$('.alert').html(data.success.message);
$('.alert').show();
}
//
},
error: function() {
alert("Failed");}
error: function(data) {
$('.alert').html(data.responseJSON.error);
$('.alert').show();}
});
})
})
+15 -5
View File
@@ -4,6 +4,7 @@
<title>AzureUI - Term</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/global.style.css" />
@@ -37,8 +38,8 @@
</div>
<select class="form-element">
<option value="">Select your country</option>
<option value="1" selected>Malaysia</option>
<option value="2">China</option>
<option value="1" selected>Malaysia +6</option>
<option value="2">China +86</option>
</select>
</div>
@@ -46,10 +47,15 @@
<div style="position:absolute; top:10px">
<a class="fa fa-phone"></a>
</div>
<input id="mobile" type="text" class="form-element" placeholder="Enter your phone number" required />
<input id="mobile" type="tel" class="form-element" placeholder="Enter your phone number" required />
</div>
</div>
<div class="form-divider"></div>
<!--Error Alert-->
<div class="alert alert-danger" role="alert" style="display: none"></div>
<!-- AzFooter Start Here-->
<div class="azfooter">
<div class="azfmain-button">
@@ -71,6 +77,8 @@
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script type="text/javascript">
function createCookie(name, value, days) {
var expires;
@@ -97,8 +105,10 @@
document.location.href="verify-code-number.html";
},
Cookies:createCookie('phone', mobile, 60),
error: function() {
alert("Failed");}
error: function(data) {
$('.alert').html(data.responseJSON.message);
$('.alert').show();
}
});
})
})
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Create</title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,92 @@
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html,
body {
background-color: #fff;
color: #636b6f;
font-family: 'Raleway', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links>a {
color: #636b6f;
padding: 0 25px;
font-size: 12px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login') }}">Login</a>
<a href="{{ route('register') }}">Register</a>
@endauth
</div>
@endif
<div class="content">
<div class="title m-b-md">
<p2>Laravel</p2>
</div>
</div>
</div>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
</head>
<body>
<div>
Hi {{ $name }},
<br>
Thank you for creating an account with us. Don't forget to complete your registration!
<br>
Please click on the link below or copy it into the address bar of your browser to confirm your email address:
<br>
<a href="{{ url('user/verify', $verification_code)}}">Confirm my email address </a>
<br/>
</div>
</body>
</html>
+95
View File
@@ -0,0 +1,95 @@
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Raleway', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 12px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login') }}">Login</a>
<a href="{{ route('register') }}">Register</a>
@endauth
</div>
@endif
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div class="links">
<a href="https://laravel.com/docs">Documentation</a>
<a href="https://laracasts.com">Laracasts</a>
<a href="https://laravel-news.com">News</a>
<a href="https://forge.laravel.com">Forge</a>
<a href="https://github.com/laravel/laravel">GitHub</a>
</div>
</div>
</div>
</body>
</html>
-95
View File
@@ -1,95 +0,0 @@
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Raleway', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 12px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login') }}">Login</a>
<a href="{{ route('register') }}">Register</a>
@endauth
</div>
@endif
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div class="links">
<a href="https://laravel.com/docs">Documentation</a>
<a href="https://laracasts.com">Laracasts</a>
<a href="https://laravel-news.com">News</a>
<a href="https://forge.laravel.com">Forge</a>
<a href="https://github.com/laravel/laravel">GitHub</a>
</div>
</div>
</div>
</body>
</html>
+14
View File
@@ -36,6 +36,12 @@ Route::put('/warehousearr/{wa_id}','WarehousearrangementController@update');//up
Route::post('/decision','WarehousearrangementController@storedecision');//decision reject and request the wrn
Route::post('/decision/decisionitem','WarehousearrangementController@storedecisionitem');//decision item for reject and request
//Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
//});
Route::post('register', 'AuthController@register');
/* Authentication */
Route::post('login', 'AuthController@login');
Route::post('password/recover', 'AuthController@recover');
@@ -50,6 +56,14 @@ Route::group(['middleware' => ['jwt.auth']], function() {
return response()->json(['user'=> $request->user()]);
});
/*Delivery-Info in profile menu*/
Route::get('/deliveryinfo','DeliveryinfoController@index');
Route::get('/deliveryinfo/{com_id}','DeliveryinfoController@show');
Route::post('/deliveryinfo', 'DeliveryinfoController@store');
Route::put('/deliveryinfo/{com_id}', 'DeliveryinfoController@update');
Route::delete('/deliveryinfo/{com_id}', 'DeliveryinfoController@destroy');
/* Company */
Route::patch('/company', 'CompanyController@update'); //update company information
Route::post('/company/company_profile/', 'CompanyController@companyProfile');//upload company profile picture
+10 -3
View File
@@ -11,9 +11,16 @@
|
*/
Route::get('/', function () {
return view('welcome');
});
/* Routes for the DeliveryInfo in profile*/
// Route::get('/company/deliveryinfo','DeliveryinfoController@index');
// Route::get('/company/{com_id}/deliveryinfo','DeliveryinfoController@show');
// Route::post('/company/{com_id}/deliveryinfo', 'DeliveryinfoController@store');
// Route::put('/company/{com_id}/deliveryinfo', 'DeliveryinfoController@edit');
// Route::put('/company/{com_id}/deliveryinfo', 'DeliveryinfoController@update');
// Route::delete('/company/{com_id}/deliveryinfo', 'DeliveryinfoController@delete');
//Route::post('login', 'AuthController@login');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
+84
View File
@@ -0,0 +1,84 @@
<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Storage;
use Artisan;
use App\User;
use App\Company;
use App\Deliveryinfo;
class DeliveryinfoTest extends TestCase
{
protected $company;
protected $user;
public function setUp()
{
parent::setUp();
Artisan::call('db:seed');
$this->user = factory(User::class)->create();
$this->company = $this->user->each(function ($u) {
factory(Company::class)->create([
'user_id' => $u->id,
]);
});
}
// TODO : those test is wrong, please redo later.
// public function testCreate()
// {
// $response = $this->actingAs($this->company)
// ->patchJson('/api/deliveryinfo', [
// 'branch' => 'Test',
// 'deli_info' => 'Testing',
// 'address' => 'Testing',
// 'city' => 'Test',
// 'postcode' => '12345',
// 'state' => 'Testing',
// 'country' => 'Testing',
// 'contact_person' => 'Testing',
// 'contact_person_no' => '12345'
// ]);
// $response->assertStatus(201);
// }
// public function testPUT()
// {
// $response = $this->actingAs($this->company)
// ->patchJson('/api/deliveryinfo', [
// 'branch' => 'Test',
// 'deli_info' => 'Testing',
// 'address' => 'Testing',
// 'city' => 'Test',
// 'postcode' => '12345',
// 'state' => 'Testing',
// 'country' => 'Testing',
// 'contact_person' => 'Testing',
// 'contact_person_no' => '12345'
// ]);
// $response->assertStatus(200);
// }
// public function testDELETE()
// {
// $response = $this->json('DELETE', '/api/deliveryinfo');
// $response->assertStatus(204);
// }
}