本文整理汇总了PHP中app\Address::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::create方法的具体用法?PHP Address::create怎么用?PHP Address::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Address
的用法示例。
在下文中一共展示了Address::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker::create();
$amount = 5;
for ($i = 0; $i < $amount; $i++) {
Address::create(['address' => $faker->streetAddress, 'user_id' => $i + 1, 'created_at' => $faker->date('Y-m-d H:i:s'), 'updated_at' => $faker->date('Y-m-d H:i:s')]);
}
}
示例2: create
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
protected function create(array $data)
{
$users = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'school_id' => $data['school_id']]);
$users->schools()->attach($data['school_id']);
$address = Address::create(['contact11' => $data['contact11']]);
$users->addresses()->save($address);
return $users;
}
示例3: run
public function run()
{
$types = AddressType::$types;
$keys = array_keys($types);
$faker = Factory::create();
foreach (range(0, 30) as $index) {
Address::create(['type' => $faker->randomElement($keys), 'street' => $faker->streetName, 'city' => $faker->city, 'country' => $faker->country, 'zip' => $faker->countryCode]);
}
}
示例4: retrieveOrCreate
/**
* attempts to find a matching address before creating a new instance
*/
public static function retrieveOrCreate(array $attributes = [])
{
// TODO: look up address attributes to find a match
$existing_addr = Address::where('street', $attributes['street'])->where('city', $attributes['city'])->where('state', $attributes['state'])->where('zip1', $attributes['zip1'])->first();
if ($existing_addr) {
return $existing_addr;
}
return Address::create($attributes);
}
示例5: run
public function run()
{
Address::truncate();
Address::create(['user_id' => '1', 'address1' => 'T Nagar', 'address2' => 'New York', 'city' => 'Melbourne', 'state' => 'Dubai', 'country' => 'USA', 'pin' => '4213456', 'phone' => '7234556', 'landmark' => 'Lifes easy']);
Address::create(['user_id' => '2', 'address1' => 'Anna Nagar', 'address2' => 'Yorkshire', 'city' => 'canberra', 'state' => 'Chennai', 'country' => 'UFA', 'pin' => '43433', 'phone' => '533336', 'landmark' => 'world easy']);
Address::create(['user_id' => '3', 'address1' => 'Srinagar', 'address2' => 'New Jersey', 'city' => 'Stockholm', 'state' => 'Dublin', 'country' => 'SA', 'pin' => '13456', 'phone' => '4556', 'landmark' => 'Lifes Tough']);
Address::create(['user_id' => '4', 'address1' => 'Tilak Nagar', 'address2' => 'New Delhi', 'city' => 'Qatar', 'state' => 'New Castle', 'country' => 'Canada', 'pin' => '456', 'phone' => '756', 'landmark' => 'Too easy']);
Address::create(['user_id' => '5', 'address1' => 'Nagar', 'address2' => 'York', 'city' => 'bourne', 'state' => 'Duai', 'country' => 'SAE', 'pin' => '42456', 'phone' => '756', 'landmark' => 'Lifes!!!!!!!!!!!!']);
}
示例6: run
public function run()
{
$faker = Faker::create();
//Category
for ($i = 0; $i < 10; $i++) {
$user = User::select(['id'])->where('id', rand(1, User::count()))->first();
$address = Address::create(['user_id' => $i <= 2 ? 4 : $user->id, 'default' => 0, 'line1' => $faker->streetAddress, 'line2' => $faker->streetAddress, 'phone' => $faker->e164PhoneNumber, 'name_contact' => $faker->streetName, 'zipcode' => $faker->postcode, 'city' => $faker->city, 'country' => $faker->country, 'state' => $faker->state]);
}
}
示例7: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// We want to delete the table if it exists before running the seed
DB::table('address')->delete();
$seederData = array(['text' => 'We offer you awesome tours', 'address' => 'Moonshine St. 14/05 Light, Jupiter', 'phone' => '+00 (123) 456 78 90', 'mail' => 'excursion@gmail.com']);
foreach ($seederData as $item) {
Address::create($item);
}
}
示例8: store
/**
* Store a newly created resource in storage.
*
* @param CreateStaffRequest $request
*
* @return \Illuminate\Http\Response
*/
public function store(CreateStaffRequest $request)
{
$staff = User::create(['name' => ucwords($request->name), 'bday' => $request->bday, 'gender' => $request->gender, 'email' => $request->email, 'password' => bcrypt($request->password)]);
$address = Address::create(['contact11' => $request->contact11]);
$staff->addresses()->save($address);
foreach (Auth::user()->schools()->lists('school_id')->toArray() as $k => $v) {
$value = $v;
}
$school = School::find($value);
$staff->schools()->attach($school);
return redirect('principal/create#staff-tab')->withInput();
}
示例9: store
/**
* Store a newly created resource in storage.
*
* @param CreateStudentRequest $request
* @return \Illuminate\Http\Response
*/
public function store(CreateStudentRequest $request)
{
$student = Student::create(['student' => ucwords($request->student), 'bday' => $request->bday, 'gender' => $request->gender, 'email' => $request->email]);
$address = Address::create(['contact11' => $request->contact11]);
$student->addresses()->save($address);
foreach (Auth::user()->schools()->lists('school_id')->toArray() as $k => $v) {
$value = $v;
}
$school = School::find($value);
$grade = Grade::find($request->grade_id);
$student->schools()->attach($school);
$student->grades()->attach($grade);
return redirect('principal/create#student-tab')->withInput();
}
示例10: run
public function run()
{
$faker = Faker::create();
$user = User::select('id')->where('id', 4)->first();
for ($j = 0; $j < 2; $j++) {
$userPoints = UserPoints::create(['user_id' => $user->id, 'action_type_id' => 6, 'source_id' => 1, 'points' => 100]);
}
$userAddress = Address::create(['user_id' => $user->id, 'default' => 1, 'line1' => $faker->streetAddress, 'line2' => $faker->streetAddress, 'phone' => $faker->e164PhoneNumber, 'name_contact' => $faker->streetName, 'zipcode' => $faker->postcode, 'city' => $faker->city, 'country' => $faker->country, 'state' => $faker->state]);
$catforseed = Category::where('type', 'store')->first();
$seededProduct = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'My Seeded Product', 'description' => $faker->text(90), 'price' => $faker->randomNumber(2), 'stock' => 100, 'type' => 'software', 'sale_counts' => $faker->randomNumber(9), 'view_counts' => $faker->randomNumber(9), 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'features' => json_encode(['images' => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], trans('globals.product_features.weight') => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(['Mg', 'Gr', 'Kg', 'Oz', 'Lb']), trans('globals.product_features.dimensions') => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(['inch', 'mm', 'cm']), trans('globals.product_features.color') => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '3', 'rate_count' => '5', 'tags' => json_encode($faker->word . ',' . $faker->word . ',' . $faker->word)]);
for ($j = 0; $j < 5; $j++) {
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'address_id' => $userAddress->id, 'status' => 'closed', 'type' => 'order', 'description' => '', 'seller_id' => 3, 'end_date' => $faker->dateTime(), 'detail' => ['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime(), 'rate' => $faker->numberBetween(1, 5), 'rate_comment' => $faker->text(90)]]);
}
$seededProduct2 = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'Another Seeded Product', 'description' => $faker->text(90), 'stock' => 100, 'type' => 'software', 'sale_counts' => $faker->randomNumber(9), 'view_counts' => $faker->randomNumber(9), 'price' => $faker->randomNumber(2), 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'stock' => 100, 'features' => json_encode(['images' => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], trans('globals.product_features.weight') => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(['Mg', 'Gr', 'Kg', 'Oz', 'Lb']), trans('globals.product_features.dimensions') => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(['inch', 'mm', 'cm']), trans('globals.product_features.color') => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '4', 'rate_count' => '5', 'tags' => json_encode($faker->word . ',' . $faker->word . ',' . $faker->word)]);
$seededProduct3 = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'More on Seeded Product', 'description' => $faker->text(90), 'stock' => 100, 'type' => 'software', 'sale_counts' => $faker->randomNumber(9), 'view_counts' => $faker->randomNumber(9), 'price' => $faker->randomNumber(2), 'stock' => 100, 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'features' => json_encode(['images' => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], trans('globals.product_features.weight') => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(['Mg', 'Gr', 'Kg', 'Oz', 'Lb']), trans('globals.product_features.dimensions') => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(['inch', 'mm', 'cm']), trans('globals.product_features.color') => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '4', 'rate_count' => '5', 'tags' => json_encode($faker->word . ',' . $faker->word . ',' . $faker->word)]);
// Creates closed orders for rates and mails
for ($j = 0; $j < 5; $j++) {
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'address_id' => $userAddress->id, 'status' => 'closed', 'type' => 'order', 'description' => '', 'seller_id' => 3, 'end_date' => $faker->dateTime(), 'details' => [['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()], ['product_id' => $seededProduct2->id, 'price' => $seededProduct2->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()], ['product_id' => $seededProduct3->id, 'price' => $seededProduct3->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()]]]);
}
// Create an open order to test notices
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'status' => 'open', 'type' => 'order', 'description' => '', 'seller_id' => 3, 'address_id' => $userAddress->id, 'details' => [['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '3']]]);
}
示例11: run
public function run()
{
$faker = Faker::create();
$user = Person::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'birthday' => $faker->dateTimeBetween('-40 years', '-16 years'), 'sex' => $faker->randomElement(['male', 'female']), 'user' => ['nickname' => 'seededuser', 'email' => 'user@gmail.com', 'password' => Hash::make('123456'), 'pic_url' => '/pt-default/' . $faker->numberBetween(1, 20) . '.jpg', 'twitter' => '@' . $faker->userName, 'facebook' => $faker->userName]])->user;
for ($j = 0; $j < 2; $j++) {
$userPoints = UserPoints::create(['user_id' => $user->id, 'action_type_id' => 6, 'source_id' => 1, 'points' => 10000]);
}
$userAddress = Address::create(['user_id' => $user->id, 'default' => 1, 'line1' => $faker->streetAddress, 'line2' => $faker->streetAddress, 'phone' => $faker->phoneNumber, 'name_contact' => $faker->streetName, 'zipcode' => $faker->postcode, 'city' => $faker->city, 'country' => $faker->country, 'state' => $faker->state]);
$company_name = 'seededinc_inc';
$enterprise = Business::create(['business_name' => $company_name, 'creation_date' => $faker->date(), 'local_phone' => $faker->phoneNumber, 'user' => ['nickname' => 'seededinc', 'email' => 'octasan.trabajo@gmail.com', 'password' => Hash::make('123456'), 'pic_url' => '/pt-default/' . $faker->numberBetween(1, 20) . '.jpg', 'twitter' => '@' . $company_name, 'facebook' => $company_name]])->user;
$catforseed = Category::where('type', 'store')->first();
$seededProduct = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'My Seeded Product', 'description' => $faker->text(90), 'price' => $faker->randomNumber(2), 'stock' => 100, 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'features' => json_encode(["images" => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], "weight" => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(["Mg", "Gr", "Kg", "Oz", "Lb"]), "dimensions" => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(["inch", "mm", "cm"]), "color" => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '3', 'rate_count' => '5', 'tags' => $faker->word . ',' . $faker->word . ',' . $faker->word]);
for ($j = 0; $j < 5; $j++) {
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'address_id' => $userAddress->id, 'status' => 'closed', 'type' => 'order', 'description' => '', 'seller_id' => $enterprise->id, 'end_date' => $faker->dateTime(), 'detail' => ['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime(), 'rate' => $faker->numberBetween(1, 5), 'rate_comment' => $faker->text(90)]]);
}
$seededProduct2 = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'Another Seeded Product', 'description' => $faker->text(90), 'price' => $faker->randomNumber(2), 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'stock' => 100, 'features' => json_encode(["images" => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], "weight" => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(["Mg", "Gr", "Kg", "Oz", "Lb"]), "dimensions" => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(["inch", "mm", "cm"]), "color" => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '4', 'rate_count' => '5', 'tags' => $faker->word . ',' . $faker->word . ',' . $faker->word]);
$seededProduct3 = Product::create(['category_id' => $catforseed->id, 'user_id' => '3', 'name' => 'More on Seeded Product', 'description' => $faker->text(90), 'price' => $faker->randomNumber(2), 'stock' => 100, 'brand' => $faker->randomElement(['Apple', 'Gigabyte', 'Microsoft', 'Google. Inc', 'Samsung', 'Lg']), 'features' => json_encode(["images" => ['/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg', '/img/pt-default/' . $faker->numberBetween(1, 330) . '.jpg'], "weight" => $faker->numberBetween(10, 150) . ' ' . $faker->randomElement(["Mg", "Gr", "Kg", "Oz", "Lb"]), "dimensions" => $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' X ' . $faker->numberBetween(1, 30) . ' ' . $faker->randomElement(["inch", "mm", "cm"]), "color" => $faker->safeColorName]), 'condition' => $faker->randomElement(['new', 'refurbished', 'used']), 'low_stock' => $faker->randomElement([5, 10, 15]), 'rate_val' => '4', 'rate_count' => '5', 'tags' => $faker->word . ',' . $faker->word . ',' . $faker->word]);
//Creates closed orders for rates and mails
for ($j = 0; $j < 5; $j++) {
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'address_id' => $userAddress->id, 'status' => 'closed', 'type' => 'order', 'description' => '', 'seller_id' => $enterprise->id, 'end_date' => $faker->dateTime(), 'details' => [['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()], ['product_id' => $seededProduct2->id, 'price' => $seededProduct2->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()], ['product_id' => $seededProduct3->id, 'price' => $seededProduct3->price, 'quantity' => '1', 'delivery_date' => $faker->dateTime()]]]);
}
//Create an open order to test notices
Order::create(['user_id' => $user->id, 'seller_id' => '3', 'status' => 'open', 'type' => 'order', 'description' => '', 'seller_id' => $enterprise->id, 'address_id' => $userAddress->id, 'details' => [['product_id' => $seededProduct->id, 'price' => $seededProduct->price, 'quantity' => '3']]]);
}
示例12: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$data = $request->all();
$validator = $this->validator($data);
if ($validator->fails()) {
return response(['errors' => $validator->messages()], 400);
}
// create appointment address (identical to the user's address but NOT the same)
$oldAddress = Address::find($data['address_id']);
$newAddress = new Address();
$address = $newAddress->create(array_except($oldAddress->toArray(), ['id']));
$data = array_except($data, ['address_id']);
$data['end_user_id'] = Auth::user()->userable->id;
// store
$appointment = new Appointment();
$newAppointment = $appointment->create($data);
// Insert related address
$newAppointment->address()->associate($address);
// Reward user for online appointment
$points = Config::get('services.points.online_appointment');
Auth::user()->userable->addPoints($points, 'Online appointment');
$newAppointment['points_rewarded'] = $points;
return response($newAppointment->load('address')->load('mastori'), 201);
}
示例13: storeStudentIndividual
private function storeStudentIndividual()
{
$var = DB::transaction(function ($connection) {
$membership_period = Input::get('membership-period');
$salutation = Input::get('salutation');
$fname = Input::get('fname');
$mname = Input::get('mname');
$lname = Input::get('lname');
$card_name = Input::get('card_name');
$dob = Input::get('dob');
$gender = Input::get('gender');
$country = Input::get('country');
$state = Input::get('state');
$address = Input::get('address');
$city = Input::get('city');
$pincode = Input::get('pincode');
$stud_branch = Input::get('stud_branch');
$college = Input::get('college');
$course = Input::get('course');
$cbranch = Input::get('cbranch');
$cduration = Input::get('cduration');
$email1 = Input::get('email1');
$email2 = Input::get('email2');
$std = Input::get('std');
$phone = Input::get('phone');
$country_code = Input::get('country-code');
$mobile = Input::get('mobile');
$paymentMode = Input::get('paymentMode');
$tno = Input::get('tno');
$drawn = Input::get('drawn');
$bank = Input::get('bank');
$branch = Input::get('branch');
$paymentReciept = Input::file('paymentReciept');
$amountPaid = Input::get('amountPaid');
$student_branch = AcademicMember::Where('is_student_branch', $stud_branch)->first();
$chapter = $student_branch->institution->member->csi_chapter_id;
$member = new Member();
$member->membership_id = 2;
// individual member
$membership_type = 3;
// student member
$member->csi_chapter_id = $chapter;
$member->email = $email1;
$member->email_extra = $email2;
$member->password = bcrypt('1234');
$member->save();
$member->id;
$filename = $member->id . '.';
$filename .= $paymentReciept->getClientOriginalExtension();
Address::create(['type_id' => 1, 'member_id' => $member->id, 'country_code' => $country, 'state_code' => $state, 'address_line_1' => $address, 'city' => $city, 'pincode' => $pincode]);
Phone::create(['member_id' => $member->id, 'std_code' => $std, 'landline' => $phone, 'country_code' => $country_code, 'mobile' => $mobile]);
$paymentReciept->move(storage_path('uploads/payment_proofs'), $filename);
$individual = Individual::create(['member_id' => $member->id, 'membership_type_id' => $membership_type, 'salutation_id' => $salutation, 'first_name' => $fname, 'middle_name' => $mname, 'last_name' => $lname, 'card_name' => $card_name, 'gender' => $gender, 'dob' => $dob]);
$student_details = StudentMember::create(['id' => $individual->id, 'student_branch_id' => $student_branch->id, 'college_name' => $college, 'course_name' => $course, 'course_branch' => $cbranch, 'course_duration' => $cduration]);
// 2nd arg is currency.. needs to be queried to put here
$head = PaymentHead::getHead($membership_period, 1)->first();
$payment = Payment::create(['paid_for' => $member->id, 'payment_head_id' => $head->id, 'service_id' => 1]);
$narration = Narration::create(['payer_id' => $member->id, 'mode' => $paymentMode, 'transaction_number' => $tno, 'bank' => $bank, 'branch' => $branch, 'date_of_payment' => $drawn, 'drafted_amount' => $head->amount, 'paid_amount' => $amountPaid, 'proof' => $filename]);
$journal = Journal::create(['payment_id' => $payment->id, 'narration_id' => $narration->id]);
if (!is_null($member->id) && $member->id > 0) {
$user = $member;
}
return $member;
});
return $var;
}
示例14: addAddress
public static function addAddress($addressData)
{
log::info($addressData);
$addressId = Address::create($addressData)->id;
return $addressId;
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(AddressRequest $request, Order $order)
{
$order->address()->associate(Address::create($request->all()))->save();
return redirect(route('orders.show', [$order->id]))->with('success', 'Address added');
}