Hi guys how can i insert data in two different tables at the same time?

|
favourebrusi 2021-04-21 10:11:50
favourebrusi 2021-04-21 10:11:20

Having an error when inserting date into database in laravel 8

trillzglobal 2021-04-21 10:12:03
abysnia 2021-04-21 09:13:35
Hi guys how can i insert data in two different tables at the same time?

Why do you want to do that. It create redundancy. Use a foreign key relationship

Sridharmca 2021-04-21 10:12:21
Any ideas tell please bro
Vladij1989 2021-04-21 10:12:32
favourebrusi 2021-04-21 10:11:50
Having an error when inserting date into database in laravel 8

use Carbon

abysnia 2021-04-21 10:12:41
trillzglobal 2021-04-21 10:12:03
Why do you want to do that. It create redundancy. Use a foreign key relationship

assumin you want to save a number and gender in different tables?

favourebrusi 2021-04-21 10:12:55
Vladij1989 2021-04-21 10:12:32
use Carbon

Have tried using carbon same error

favourebrusi 2021-04-21 10:13:08
favourebrusi 2021-04-21 10:12:55
Have tried using carbon same error

Can I get a sample code

Vladij1989 2021-04-21 10:13:35
favourebrusi 2021-04-21 10:12:55
Have tried using carbon same error

show type column

favourebrusi 2021-04-21 10:13:56
Vladij1989 2021-04-21 10:13:35
show type column

Don’t understand

trillzglobal 2021-04-21 10:14:05
favourebrusi 2021-04-21 10:11:50
Having an error when inserting date into database in laravel 8

Your data should be date(“Y-m-d H:i:s”, strtotime($request->date));

Vishal 2021-04-21 10:14:17
Use $timestamp -> false
favourebrusi 2021-04-21 10:14:56
Vishal 2021-04-21 10:14:17
Use $timestamp -> false

Where would I insert this

Batu157 2021-04-21 10:15:20
favourebrusi 2021-04-21 10:14:56
Where would I insert this

In your model

Vishal 2021-04-21 10:16:02
Yes in your model
favourebrusi 2021-04-21 10:18:24
Vishal 2021-04-21 10:14:17
Use $timestamp -> false

laravel_discuss-77448.jpg

Vishal 2021-04-21 10:19:04
Its public $timestamps=false
absoluthalal 2021-04-21 10:19:04
favourebrusi 2021-04-21 10:18:24

paste this code:
$timestamp->false;

absoluthalal 2021-04-21 10:20:31
Vishal 2021-04-21 10:19:04
Its public $timestamps=false

in model, paste this code @favourebrusi
$timestamps = false;

Vishal 2021-04-21 10:21:25
I am getting and error while retriving code from DB its shows that undefined variable in foreach loop i already define it in my controller
Vishal 2021-04-21 10:21:46
Is there any suggestions what should i do?
favourebrusi 2021-04-21 10:22:24
Vishal 2021-04-21 10:21:25
I am getting and error while retriving code from DB its shows that undefined variable in foreach loop i already define it in my controller

Did you return it using compact

favourebrusi 2021-04-21 10:23:45
absoluthalal 2021-04-21 10:20:31
in model, paste this code @favourebrusi
$timestamps = false;

laravel_discuss-77456.jpg

favourebrusi 2021-04-21 10:23:45
absoluthalal 2021-04-21 10:20:31
in model, paste this code @favourebrusi
$timestamps = false;

laravel_discuss-77455.jpg

Vishal 2021-04-21 10:24:17
laravel_discuss-77457.jpg
This is my controller’s function for showing data
Vishal 2021-04-21 10:25:11
favourebrusi 2021-04-21 10:23:45

Still getting error?

favourebrusi 2021-04-21 10:29:17
absoluthalal 2021-04-21 10:20:31
in model, paste this code @favourebrusi
$timestamps = false;

laravel_discuss-77459.jpg
Same error

favourebrusi 2021-04-21 10:29:40
Vishal 2021-04-21 10:25:11
Still getting error?

Yes

absoluthalal 2021-04-21 10:30:15
favourebrusi 2021-04-21 10:29:17
Same error

what is DOB column type?

SL 2021-04-21 10:55:48
I think you can try Date format just : date(y m d, date)
favourebrusi 2021-04-21 11:19:41
Vishal 2021-04-21 10:24:17
This is my controller’s function for showing data

laravel_discuss-77464.jpg
Do something like this

favourebrusi 2021-04-21 11:20:02
absoluthalal 2021-04-21 10:30:15
what is DOB column type?

Date

meetlunkad 2021-04-21 11:20:22
Route::domain(‘{tenant}.localhost’)->middleware(‘tenant’)->group(function(){
Route::prefix(‘owner’)->middleware([‘auth’, ‘owner’])->group(function () {
Route::get(‘/Entries/edit/{id}’,function($id){
echo $id;
});
});
});

output gives tenant name

meetlunkad 2021-04-21 11:20:38
Please help
How to get id and not tenant
favourebrusi 2021-04-21 11:23:07
SL 2021-04-21 10:55:48
I think you can try Date format just : date(y m d, date)

Didn’t work

saurabh dave 2021-04-21 11:48:43
hi All
We are looking for a full time laravel developer with minimum 2+ years of exp. The opportunity is to work for a well established product company.
Anybody interested please message.

Thanks
Saurabh Dave

|