How do you wanna show here?

|
kev 2022-04-15 18:02:52
themanojyadav 2022-04-15 17:48:02
Simply you can use if condition with specify the roles stores in session or Auth::user()->role

this works thanks alot

themanojyadav 2022-04-15 18:12:41
kev 2022-04-15 18:02:52
this works thanks alot

No problem

Venusky 2022-04-15 18:58:25
Il salut, il y a des francophones ici?
J’ai besoins d’aide en laravel
Je veux pouvoir récupérer le libellé d’une clé étrangère dans sa table et l’afficher
devpsoft 2022-04-15 19:10:55
Venusky 2022-04-15 18:58:25
Il salut, il y a des francophones ici?
J’ai besoins d’aide en laravel
Je veux pouvoir récupérer le libellé d’une clé étrangère dans sa table et l’afficher

creer une fonction dans model
public function fon_name(){
return $this->belongsTo(Parent::class,’cle_etran’,’cle_p’);
}

devpsoft 2022-04-15 19:11:26
$model_item->fon_name->libelle
Venusky 2022-04-15 19:14:14
devpsoft 2022-04-15 19:10:55
creer une fonction dans model
public function fon_name(){
return $this->belongsTo(Parent::class,’cle_etran’,’cle_p’);
}

Ok merci beaucoup, voilà j’ai ma table article qui prend la clé de ma table mesure
Menant je veux pouvoir récupérer la liste des articles avec leur mesure (libellé)

Venusky 2022-04-15 19:16:18
Au niveau du model mesure j’ai une function article(){
Return $this->hasMany(Article::class)
}
Venusky 2022-04-15 19:17:47
Au niveau de Article
J’ai: function mesure(){
return $this->belongsTo(Mesure ::class)
}
Venusky 2022-04-15 19:18:13
Menant comment faire ma requête et comment afficher dans le formulaire
devpsoft 2022-04-15 19:19:13
Venusky 2022-04-15 19:17:47
Au niveau de Article
J’ai: function mesure(){
return $this->belongsTo(Mesure ::class)
}

$article->mesure->name or any column

Venusky 2022-04-15 19:20:17
Voici ma requête : $produits= Article::with(“Mesure”)->get()
devpsoft 2022-04-15 19:20:42
and should name this article(){
Return $this->hasMany(Article::class)
}
to articles because it give many articles
devpsoft 2022-04-15 19:21:28
Venusky 2022-04-15 19:20:17
Voici ma requête : $produits= Article::with(“Mesure”)->get()

for each article use this: $article->mesure->name or any column

Venusky 2022-04-15 19:23:34
devpsoft 2022-04-15 19:21:28
for each article use this: $article->mesure->name or any column

Merci beaucoup, sa marche👍

Jyoti2083 2022-04-15 19:46:39
Vaidehi 2022-04-15 14:23:44
How ??

I set up virtual host

Jinreign 2022-04-15 20:23:41
newbie here. I just asking if my laravel file from htdocs i and have database from xampp and transfer to another PC. its not working how to solve? thank you
MerchantHussain 2022-04-15 20:45:45
laravel_discuss-115402.jpg
In database date is saved like this
MerchantHussain 2022-04-15 20:46:24
laravel_discuss-115404.jpg
but when i call in frontend it shows like this anyone could help me withthis ?
smokey_18 2022-04-15 20:46:58
MerchantHussain 2022-04-15 20:46:24
but when i call in frontend it shows like this anyone could help me withthis ?

How do you wanna show here ?

MerchantHussain 2022-04-15 20:47:08
complete date with time
smokey_18 2022-04-15 20:47:18
Jinreign 2022-04-15 20:23:41
newbie here. I just asking if my laravel file from htdocs i and have database from xampp and transfer to another PC. its not working how to solve? thank you

Can you show the error you’re getting?

MerchantHussain 2022-04-15 20:47:21
but its not showing appropriately
MerchantHussain 2022-04-15 20:47:35
not getting error i can share the query i m using
smokey_18 2022-04-15 20:47:43
MerchantHussain 2022-04-15 20:47:08
complete date with time

Can you show your migration?

MerchantHussain 2022-04-15 20:47:49
sure
smokey_18 2022-04-15 20:47:56
Okay
MerchantHussain 2022-04-15 20:49:09
laravel_discuss-115413.jpg

smokey_18 2022-04-15 20:50:17
MerchantHussain 2022-04-15 20:46:24
but when i call in frontend it shows like this anyone could help me withthis ?

How you’re fetching it here?

smokey_18 2022-04-15 20:50:27
And show me your query as well please
MerchantHussain 2022-04-15 20:50:35
yess
MerchantHussain 2022-04-15 20:52:52
laravel_discuss-115417.jpg

MerchantHussain 2022-04-15 20:53:04
this is the query
MerchantHussain 2022-04-15 20:53:34
laravel_discuss-115419.jpg
saving created at and updated at like this
smokey_18 2022-04-15 20:54:11
MerchantHussain 2022-04-15 20:53:34
saving created at and updated at like this

come pm

devpsoft 2022-04-15 22:11:32
MerchantHussain 2022-04-15 20:46:24
but when i call in frontend it shows like this anyone could help me withthis ?

$item->column_date->format(“Y-m-d H:i”)

|