Is there any possible way to do automatic translation for the lang files?

|
nowodev 2021-05-05 17:01:16
nowodev 2021-05-05 17:00:27
The approach I took to do this is not ideal and I know there are better solutions out there.

So on my main table for hostels, there’s an image column.
I have another table for images.
The image model belongsto the hostel model.
The hostel model has many image model.

I also used the image intervention package. So it stores the array of images in the Image table then inserts only one image into the Hostel table.

So in my view, I can decide if I want to show the main image or the arrays

laravel_discuss-79493.jpg

2021-05-05 17:02:49
Okay … I try to do it.
RahiMSuleymaN 2021-05-05 17:06:29
laravel_discuss-79495.jpg
hi everyone,
$items = Item::where(‘category_id’,’=’,$category_id)
->orWhere(‘name’,’LIKE’,’%’.$query.’%’)
->orWhere(‘description’,’LIKE’,’%’.$query.’%’)
->orderBY($order,$order_type)
->limit(10)
->offset(($page – 1) * 10)
->get();
I have such query ,but I want categor_id=2 AND (… OR …)
RahiMSuleymaN 2021-05-05 17:06:47
RahiMSuleymaN 2021-05-05 17:06:29
hi everyone,
$items = Item::where(‘category_id’,’=’,$category_id)
->orWhere(‘name’,’LIKE’,’%’.$query.’%’)
->orWhere(‘description’,’LIKE’,’%’.$query.’%’)
->orderBY($order,$order_type)
->limit(10)
->offset(($page – 1) * 10)
->get();
I have such query ,but I want categor_id=2 AND (… OR …)

How can I do it?

GistOf 2021-05-05 17:12:52
one_and_only_abhi 2021-05-05 16:57:40
Actually it is a ecom website, using laravel currently feel slow so we discovering ways to make it faster

If Laravel is noticeably slow, it’s something you have done. Laravel on its own loads in a tiny fraction of a second. If it’s making you wait for more than half a second, blame your code

2021-05-05 17:51:42
one_and_only_abhi 2021-05-05 16:57:40
Actually it is a ecom website, using laravel currently feel slow so we discovering ways to make it faster

This is also a type of skill test/practice in laravel, which always gives nightmare to developers.

lucasectos 2021-05-05 18:06:14
Is there any Laravel god here who knows how to use PHP global variables like $_SERVER[“SERVER_NAME”] when using queues?

The queue’s driver is database and not sync

DesolatorMagno 2021-05-05 18:15:39
No matter what Framework or language you use, if you don’t use it well you are never going to have a good app. When ppl say that Laravel is Slower, it not mean that is second slower, it is just fraction of seconds.
natghi2010 2021-05-05 18:20:07
What are the hardest interview questions for laravel you have ever faced?
2021-05-05 18:28:39
Hi any one have application on laravel IMAP
2021-05-05 18:28:53
Webklex php-imap
DesolatorMagno 2021-05-05 18:34:36
natghi2010 2021-05-05 18:20:07
What are the hardest interview questions for laravel you have ever faced?

Depends, for example, i was asked once in the middle of a interview:

“Tell me a Laravel command.”

It felt so out of place that i answered it like a question and after that i lost the cool 😅.

natghi2010 2021-05-05 18:35:04
DesolatorMagno 2021-05-05 18:34:36
Depends, for example, i was asked once in the middle of a interview:

“Tell me a Laravel command.”

It felt so out of place that i answered it like a question and after that i lost the cool 😅.

What is a larvel command

DesolatorMagno 2021-05-05 18:35:46
i guess that “php artisan make:model Products”
natghi2010 2021-05-05 18:37:05
DesolatorMagno 2021-05-05 18:35:46
i guess that “php artisan make:model Products”

Ok thanks will come in handy

2021-05-05 18:37:42
2021-05-05 18:28:39
Hi any one have application on laravel IMAP

Can anyone help me please

Zoxedlimitless 2021-05-05 19:59:47
is there any possible way to do automatic translation for the lang files ?
ibrahim 2021-05-05 20:00:37
do u man static string?
ibrahim 2021-05-05 20:00:52
yes, u can do it
ibrahim 2021-05-05 20:01:28
mean*
Zoxedlimitless 2021-05-05 20:03:36
should i need some dependency ?
ibrahim 2021-05-05 20:03:58
no,
Zoxedlimitless 2021-05-05 20:04:52
<?php

return [
’email’ => ‘Email’,
‘address_school’ => ‘School address’,
];

Zoxedlimitless 2021-05-05 20:05:10
i wanna translate only school address
Zoxedlimitless 2021-05-05 20:05:28
and email ofc
Zoxedlimitless 2021-05-05 20:05:51
lets say in french how should i adresse this problem
Zoxedlimitless 2021-05-05 20:06:17
i don’t wanna create other files and do it in the static way
Azad Akhtar 2021-05-05 20:07:16
Hello everyone.. anybody can help me.
How to pass 5 models data in one return data
Azad Akhtar 2021-05-05 20:07:33
laravel_discuss-79528.jpg

Azad Akhtar 2021-05-05 20:08:01
I know this is wrong way to pass all models data..
How to pass in one
sbruder 2021-05-05 20:11:02
Azad Akhtar 2021-05-05 20:07:16
Hello everyone.. anybody can help me.
How to pass 5 models data in one return data

Just return an array

Azad Akhtar 2021-05-05 20:12:41
Yes… I know but I need to add in one array of all models data
DesolatorMagno 2021-05-05 20:19:23
Them just do it, you just need to fill a array with all the data.
pavelk1103 2021-05-05 20:52:43
Azad Akhtar 2021-05-05 20:12:41
Yes… I know but I need to add in one array of all models data

You have two ways.
1) Make all of the different variables and assign it to array. $data[] = [$var, $var2, $var3 …]
2) Use array_push function https://www.php.net/manual/en/function.array-push.php

pavelk1103 2021-05-05 20:52:56
The first way is better
|