Now if I want to insert new data or update data in both tables, how would I do that programtically in laravel?

|
yoofi_graham 2019-02-10 11:14:05
Joshteek 2019-02-10 11:07:14
Repeat the process with as much as you want

//search user
$newSearch = new User;

$newSearch = $newSearch->where(‘name’, ‘=’, $name);

$newSearch = $newSearch->where(‘phone’, ‘=’, $phone);

$newSearch = $newSearch->where(‘country’, ‘=’, $country);

E.t.c…

Alright thanks

scaryMC 2019-02-10 11:31:20
Hello all. Isn’t better for admin to create a Discord channel so that it would be nice to read code shared by someone with wants to be assist ?
2019-02-10 11:34:25
hi evry one

i need two laravel developer professional with good salary in iran

country: iran state :azarbayjan-sharqi city: tabriz

and iranian guys if you have any laravel full persian groups tell me that please

excuse me i dont know group law and in fact i create one ads post if it has illegal post forgive me for that,..

YashGhantala 2019-02-10 11:38:16
how to make different Model for Admin and manager role LOGIN
YashGhantala 2019-02-10 11:41:38
i want different table for admin ,manager and Users
2019-02-10 11:41:55
YashGhantala 2019-02-10 11:38:16
how to make different Model for Admin and manager role LOGIN

if you want manage just roles you can create a middleware just for admins for current roles

but if you want create a model and that exists and you want create another model exactly like that create one model with diffrent name or create with that name in another directory

YashGhantala 2019-02-10 11:42:28
2019-02-10 11:41:55
if you want manage just roles you can create a middleware just for admins for current roles

but if you want create a model and that exists and you want create another model exactly like that create one model with diffrent name or create with that name in another directory

Thnx

2019-02-10 11:42:39
YashGhantala 2019-02-10 11:42:28
Thnx

good luck

2019-02-10 11:57:26
Guys…let’s say I have two tables and records in table a relies on records in table b.

Now if I want to insert new data or update data in both tables, how would I do that programtically in laravel?

adoniasdantas 2019-02-10 13:24:27
2019-02-10 11:57:26
Guys…let’s say I have two tables and records in table a relies on records in table b.

Now if I want to insert new data or update data in both tables, how would I do that programtically in laravel?

You can use boot method on the Model, or can create an event and call it every time you wanna insert or update new data

2019-02-10 14:09:05
Err… doesn’t running a model at boot means that it’s code would be run at the start of the app?
2019-02-10 19:29:58
laravel_discuss-1981.jpg

2019-02-10 19:30:05
2019-02-10 19:29:58

What’s the problem?

2019-02-10 19:30:19
laravel_discuss-1983.jpg
Route
2019-02-10 19:30:29
laravel_discuss-1984.jpg
User Model
2019-02-10 19:39:50
2019-02-10 19:30:05
What’s the problem?

Run this command :

2019-02-10 19:40:06
2019-02-10 19:39:50
Run this command :

php artisan migrate

c0urage 2019-02-12 05:04:09
Hey guys, I would like to disable registration for my panel since it is an admin panel.
c0urage 2019-02-12 05:04:12
How do I do that?
emendescv 2019-02-12 06:48:55
Need Help here
emendescv 2019-02-12 06:49:02
laravel_discuss-2012.jpg

emendescv 2019-02-12 06:49:08
<?php

use IlluminateDatabaseSeeder;

class ContatoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Opção 1
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);

// Opção 2
factory(AppContato::class, 20)->create();
}
}

emendescv 2019-02-12 06:49:22
this is my code and I can’t find the error
StanleyMasinde 2019-02-12 06:52:13
c0urage 2019-02-12 05:04:09
Hey guys, I would like to disable registration for my panel since it is an admin panel.

The
auth::routes()
Method takes parameters.

You can pass an array
auth::routes([“register” => false])

StanleyMasinde 2019-02-12 06:53:33
When you click register you will get a 404 exception
StanleyMasinde 2019-02-12 06:54:46
emendescv 2019-02-12 06:49:08
<?php

use IlluminateDatabaseSeeder;

class ContatoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Opção 1
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);

// Opção 2
factory(AppContato::class, 20)->create();
}
}

Please format your code in markdown… “

StanleyMasinde 2019-02-12 06:55:46
emendescv 2019-02-12 06:49:02

And this is a syntax error. Check for commas etc

emendescv 2019-02-12 06:55:57
StanleyMasinde 2019-02-12 06:54:46
Please format your code in markdown… “

What do you mean by format my code in markdown?

emendescv 2019-02-12 06:56:27
they all seems to be ok
emendescv 2019-02-12 06:56:30
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);
StanleyMasinde 2019-02-12 06:56:31
StanleyMasinde 2019-02-12 06:52:13
The
auth::routes()
Method takes parameters.

You can pass an array
auth::routes([“register” => false])

Look at my code here. You see it’s in monospace and readable

StanleyMasinde 2019-02-12 06:57:17
<?php

use IlluminateDatabaseSeeder;

class ContatoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Opção 1
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);

// Opção 2
factory(AppContato::class, 20)->create();
}
}

StanleyMasinde 2019-02-12 06:57:31
StanleyMasinde 2019-02-12 06:57:17
<?php

use IlluminateDatabaseSeeder;

class ContatoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Opção 1
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);

// Opção 2
factory(AppContato::class, 20)->create();
}
}

This is what I mean

StanleyMasinde 2019-02-12 06:59:04
StanleyMasinde 2019-02-12 06:57:17
<?php

use IlluminateDatabaseSeeder;

class ContatoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Opção 1
DB::table(‘contatos’)->insert([
‘saudacao’ => ‘Sr.’,
‘nome’ => ‘Edson Mendes’,
‘telefone’ => ‘(23)89823-7600’,
‘data_nascimento’ => ‘1985/07/29′,
’email’ => ’emendes@cvhost.cv’,
‘nota’ => ‘Utilizador criado usando o Seeder com método DB’,
‘created_at’ => date(‘Y-m-d H:i:s’)
]);

// Opção 2
factory(AppContato::class, 20)->create();
}
}

Still not readable use pastebin.com

emendescv 2019-02-12 07:02:22
still don’t get it
emendescv 2019-02-12 07:02:24
https://pastebin.com/KiGV7QxB

<?php use IlluminateDatabaseSeeder; class ContatoTableSeeder extends See – Pastebin.comPastebin
emendescv 2019-02-12 07:02:49
Sory I’m really new to Laravel 😉
StanleyMasinde 2019-02-12 07:03:45
emendescv 2019-02-12 07:02:49
Sory I’m really new to Laravel 😉

No problem. What text editor are you using. Because Vscode won’t let you have syntax errors

emendescv 2019-02-12 07:04:06
I’m using Atom
emendescv 2019-02-12 07:04:15
I use a Mac laptop also
emendescv 2019-02-12 07:04:35
I do have PHP Storm also
StanleyMasinde 2019-02-12 07:05:30
emendescv 2019-02-12 07:04:35
I do have PHP Storm also

Set it to show you syntax errors

StanleyMasinde 2019-02-12 07:07:00
In laravel we don’t touch the created_at and updated_at files
emendescv 2019-02-12 07:07:12
Already Activate Systax error but nothing
emendescv 2019-02-12 07:07:32
I didn’t mess it them
StanleyMasinde 2019-02-12 07:07:58
The file with a problem is database seeder
StanleyMasinde 2019-02-12 07:08:13
emendescv 2019-02-12 07:07:32
I didn’t mess it them

I know. But the app fills them for you

emendescv 2019-02-12 07:08:21
hahahahha
emendescv 2019-02-12 07:08:38
I dind’t have a comma separating the array
emendescv 2019-02-12 07:08:46
Hooo my god
|