How is the recommended way to handle database changes in environments like development and production for example?

|
arafhossain 2020-06-15 19:06:27
S3NX_8 2020-06-15 18:48:38
Can i create freah copy of laravel offline if i install the laravel installer?

Are u trying to run laravel offline??

2020-06-15 19:09:03
hi every one
2020-06-15 19:09:38
please how can i add a cron job to this script for it to execute
2020-06-15 19:10:39
<?php

namespace AppHttpControllers;

use AppGeneralSetting;
use AppUserWallet;
use CarbonCarbon;
use AppInvest;
use AppTrx;
use AppUser;
use IlluminateSupportFacadesRequest;

class CronController extends Controller
{

public function cron()
{
$now = Carbon::now();

$invest = Invest::whereStatus(1)->where(‘next_time’,'<=’,$now)->get();

$gnl = GeneralSetting::first();

foreach ($invest as $data)
{
$user = User::find($data->user_id);
$userInterestWallet = UserWallet::where(‘user_id’,$data->user_id)->where(‘type’,’interest_wallet’)->first();
$next_time = Carbon::parse($now)->addHours($data->hours);

$in = Invest::find($data->id);
$in->return_rec_time = $data->return_rec_time + 1;
$in->next_time = $next_time;
$in->last_time = $now;

if ($data->period == ‘-1’)
{
$in->status = 1;
$in->save();

$new_balance = formatter_money($userInterestWallet->balance + $data->interest);
$userInterestWallet->balance = $new_balance;

Trx::create([
‘user_id’ => $user->id,
‘amount’ => $data->interest,
‘main_amo’ => $new_balance,
‘charge’ => 0,
‘type’ => ‘+’,
‘remark’ => ‘interest’,
‘title’ => ‘Interest Return ‘.$data->interest.’ ‘.$gnl->cur_text.’ Added on Your ‘.str_replace(‘_’, ‘ ‘, $userInterestWallet->type).’ Balance’,
‘trx’ => getTrx(),
]);

2020-06-15 19:10:58
$userInterestWallet->save();

if($gnl->invest_return_commission == 1){
$commissionType = formatter_money($data->interest) . ‘ ‘.$gnl->cur_text. ‘ Interest Commission’;
levelCommision($user->id, $data->interest, $commissionType);
}

}else{

if ($data->capital_status == 1)
{

if ($in->return_rec_time >= $data->period){
$bonus = $data->interest + $data->amount;
$new_balance = formatter_money($userInterestWallet->balance + $bonus);
$userInterestWallet->balance = $new_balance;
$in->status = 0;
}else{
$bonus = 0;
$new_balance = formatter_money($userInterestWallet->balance + $data->interest);
$userInterestWallet->balance = $new_balance;
$in->status = 1;
}

$in->save();

if ($bonus != 0){

Trx::create([
‘user_id’ => $user->id,
‘amount’ => $data->interest,
‘main_amo’ => $new_balance,
‘charge’ => 0,
‘type’ => ‘+’,
‘remark’ => ‘interest’,
‘title’ => ‘Interest Return ‘.$data->interest.’ ‘.$gnl->cur_text.’ Added on Your ‘.str_replace(‘_’, ‘ ‘, $userInterestWallet->type).’ Balance’,
‘trx’ => getTrx(),
]);

if($gnl->invest_return_commission == 1){
$commissionType = formatter_money($data->interest) . ‘ ‘.$gnl->cur_text. ‘ Interest Commission’;
levelCommision($user->id, $data->interest, $commissionType);
}

}else{
Trx::create([
‘user_id’ => $user->id,
‘amount’ => $data->interest,
‘main_amo’ => $new_balance,
‘charge’ => 0,
‘type’ => ‘+’,
‘remark’ => ‘interest’,
‘title’ => ‘Interest & Capital Return ‘.$bonus.’ ‘.$gnl->cur_text.’ Added on Your ‘.str_replace(‘_’, ‘ ‘, $userInterestWallet->type).’ Wallet’,
‘trx’ => getTrx(),
]);

if($gnl->invest_return_commission == 1){
$commissionType = formatter_money($data->interest) . ‘ ‘.$gnl->cur_text. ‘ Interest Commission’;
levelCommision($user->id, $data->interest, $commissionType);
}

}

2020-06-15 19:11:14
$userInterestWallet->save();

}else{

if ($in->return_rec_time >= $data->period){
$in->status = 0;
}else{
$in->status = 1;
}

$in->save();

$new_balance = formatter_money($userInterestWallet->balance + $data->interest);
$userInterestWallet->balance = $new_balance;
$userInterestWallet->save();
Trx::create([
‘user_id’ => $user->id,
‘amount’ => $data->interest,
‘main_amo’ => $new_balance,
‘charge’ => 0,
‘type’ => ‘+’,
‘remark’ => ‘interest’,
‘title’ => ‘Interest Return ‘.$data->interest.’ ‘.$gnl->cur_text.’ Added on Your ‘.str_replace(‘_’, ‘ ‘, $userInterestWallet->type).’ Wallet’,
‘trx’ => getTrx(),
]);

if($gnl->invest_return_commission == 1){
$commissionType = formatter_money($data->interest) . ‘ ‘.$gnl->cur_text. ‘ Interest Commission’;
levelCommision($user->id, $data->interest, $commissionType);
}

}

}

}

}

}

Marvixino 2020-06-15 19:44:03
Marvixino 2020-06-14 23:21:03

Guys … is this enough secure to protect Vue page?

amirAutomationEnginner 2020-06-15 19:58:21
2020-06-15 17:02:04
Please i need your help. I have this code working perfectly well offline, but the about page prompted this error the moment i uploaded it on my server

There is no user model
You delete it

2020-06-15 20:00:33
amirAutomationEnginner 2020-06-15 19:58:21
There is no user model
You delete it

I have solved it

Aravindh Gopi 2020-06-15 20:07:12
Thanks man
Jack_rub 2020-06-15 20:16:17
why u delete link
Jack_rub 2020-06-15 20:19:41
hi can anyone help me how to create ecommerce in laravel
prime 2020-06-15 21:12:12
how can i solve deceptive page…. in shared host
’| 2020-06-15 21:14:14
2020-06-15 16:10:01
It’s better to let your friend start with the design first. When finish, he sends to you and you do the beckend.

I start the work now i want to share may pages with her but i dont know what pages i send to her

DesolatorMagno 2020-06-15 21:23:11
’| 2020-06-15 21:14:14
I start the work now i want to share may pages with her but i dont know what pages i send to her

I don’t really get you, but, for example when i work i first make the general layout, and define it there will be a theme for the front pages (those that don’t require login) and admin page (those that require login), them i make a standard for Index, edit and create pages, there is also the home page and errors (404,500,etc).

prime 2020-06-15 21:24:31
prime 2020-06-15 21:12:12
how can i solve deceptive page…. in shared host

helpπŸ‘†πŸ‘†

Jack_rub 2020-06-15 21:26:49
I don’t like
Jack_rub 2020-06-15 21:27:23
Yes
Jack_rub 2020-06-15 21:28:27
I know about laravel
Jack_rub 2020-06-15 21:28:56
But dont know how to start with ecommece
Jack_rub 2020-06-15 21:29:43
Yes
Jack_rub 2020-06-15 21:30:17
Built fb poster bot
Jack_rub 2020-06-15 21:30:32
Laravel and python
Jack_rub 2020-06-15 21:31:18
But my company client want ecommece from scratch
Jack_rub 2020-06-15 21:31:38
But i dont know about ecommece
2020-06-15 21:31:48
https://cryptotabbrowser.com/12353976

CryptoTab Browser – Lightweight, fast, and ready to mine!CryptoTab Browser
CryptoTab Browser is the world’s first web browser with built-in mining features. Familiar Chrome user interface is perfectly combined with extremely fast mining speed. Mine and browse at the same time!
Jack_rub 2020-06-15 21:33:28
With api because she want jwt authentication
FlyMeSyndrom 2020-06-15 21:35:07
i wanna ask something
FlyMeSyndrom 2020-06-15 21:35:29
how to reload other ajax in ajax
FlyMeSyndrom 2020-06-15 21:35:39
without reload page
FlyMeSyndrom 2020-06-15 21:35:54
i’m still stuck in there..
Jack_rub 2020-06-15 21:40:36
As per client documents
jwt auth
Seller register
Seller create discount coupon/remove coupon
Seller add product

Payment gateway ccavenue

After sale admin cut commission and rest amount go to seller account

User dashboard
User add money etc etc

Jack_rub 2020-06-15 21:42:02
How to create wallet in laravel
S3NX_8 2020-06-15 21:45:22
arafhossain 2020-06-15 19:06:27
Are u trying to run laravel offline??

Yes

S3NX_8 2020-06-15 21:45:33
I cant get connection so
I wanted to create fresh projects many times over and over
duruiz 2020-06-15 22:50:27
hello people!
I’m deploying my first laravel project with a voyager cms and everything is going very neat, this FW is awesome. I have a question tho:
How is the recommended way to handle database changes in environments like development and production for example?
Using a CMS add’s some things in the database that need to be populated in the production server in order to everything works fine, I use the migrations for structure, but I see no recommendations to handle the actual data part of the problem.
DesolatorMagno 2020-06-15 22:51:19
seeder?
duruiz 2020-06-15 22:51:41
In the Pearl based applications at my work the folks usually goes with sqitch, but there is a more “laravel” way?
duruiz 2020-06-15 22:52:40
DesolatorMagno 2020-06-15 22:51:19
seeder?

I think it’s like the seeders, but I need the matching data, not random data.
for example, my CMS menu is handled in the database.

duruiz 2020-06-15 22:53:12
So when someone create a new menu in development this data should be in production serve at deployment
DesolatorMagno 2020-06-15 22:53:13
Seeder != random data, i have seeder for production and seeder for development.
DesolatorMagno 2020-06-15 22:57:55
But for your specific case i don’t know what could be done, i use Json and excel sheet for data from clients, and migration for dev and master, but i had never have your specific use case.
duruiz 2020-06-15 22:58:23
ok, so I can seed real data and I just need to read things more carefully? πŸ™‚
duruiz 2020-06-15 22:59:51
I just stopped here “Laravel includes a simple method of seeding your database with test data using seed classes.” when reading about DB seeding
DesolatorMagno 2020-06-15 23:00:31
I for example use Json files to store the data inside the storage folder, you don’t need to save it in git, you could use a end point that return JSON, i mean, the sky is the limit there XD
DesolatorMagno 2020-06-15 23:02:45
If you use seeder + factory, you can store fake data that is great for testing, that is true, but is not the only use.
duruiz 2020-06-15 23:04:57
I think I get how you do this, but I still have the problem where I need to compare things in a diff-like style, because my user may have inserted something in the database at the same time I’m developing a new feature, and I can’t overwrite the user data πŸ™
DesolatorMagno 2020-06-15 23:05:59
https://laravel.com/docs/7.x/eloquent#other-creation-methods
DesolatorMagno 2020-06-15 23:06:32
laravel_discuss-41647.jpg
Example
duruiz 2020-06-15 23:20:14
DesolatorMagno 2020-06-15 23:06:32
Example

So, in this scenario I’ll have a model where I put my database changes, I update it manually and run it on the deploy process?
something like that?

|