What do report you need?

|
ldefra 2020-07-17 13:33:56
$product = Product::with(‘photos’,’attributeValues.attributeGroup’,’brand’,’categories’)->inRandomOrder()->take(40)->whereHas(‘categories’, function ($query) use($id) {
$query->where(‘id’,$id);
})->toSql();
dd($product)
Try this
ldefra 2020-07-17 13:34:18
and the you run sql code in DBMS
Jihat_developer 2020-07-17 13:34:24
laravel_discuss-45198.jpg
for 3 not work
2020-07-17 13:35:00
Luige can help me ?!
Jihat_developer 2020-07-17 13:37:21
laravel_discuss-45200.jpg

Jihat_developer 2020-07-17 13:37:36
ldefra 2020-07-17 13:33:56
$product = Product::with(‘photos’,’attributeValues.attributeGroup’,’brand’,’categories’)->inRandomOrder()->take(40)->whereHas(‘categories’, function ($query) use($id) {
$query->where(‘id’,$id);
})->toSql();
dd($product)
Try this

laravel_discuss-45201.jpg

ldefra 2020-07-17 13:38:09
2020-07-17 13:35:00
Luige can help me ?!

what do report you need?

2020-07-17 13:38:38
I want package for reports
Jihat_developer 2020-07-17 13:38:42
ldefra 2020-07-17 13:33:56
$product = Product::with(‘photos’,’attributeValues.attributeGroup’,’brand’,’categories’)->inRandomOrder()->take(40)->whereHas(‘categories’, function ($query) use($id) {
$query->where(‘id’,$id);
})->toSql();
dd($product)
Try this

laravel_discuss-45204.jpg

ldefra 2020-07-17 13:39:57
Jihat_developer 2020-07-17 13:38:42

products collection is exist

ldefra 2020-07-17 13:40:23
try to see collection folder
ldefra 2020-07-17 13:40:35
2020-07-17 13:38:38
I want package for reports

i can’t help

Jihat_developer 2020-07-17 13:41:42
ldefra 2020-07-17 13:39:57
products collection is exist

ya exist , and error offces 0

Jihat_developer 2020-07-17 13:42:11
laravel_discuss-45210.jpg

ldefra 2020-07-17 13:43:48
i don’t know bro
shubhamdhyani 2020-07-17 13:54:58
desore 2020-07-17 12:52:21
I am using a mac os and been having issues setting up Laravel on my mac

What issues?

cayetanohosma 2020-07-17 14:31:30
I’m using mac for 10 years and I have not any issue with Laravel installation on my Mac
Jack_rub 2020-07-17 15:29:58
hi i want to save status but not using enum in migration can anybody help me
Priyanka Pradeep 2020-07-17 15:39:14
Jihat_developer 2020-07-17 13:42:11

Print your collection using dd and see the format

messenja 2020-07-17 15:40:34
Hi, can somebody help me with best practices for frontend / backend separation in laravel 7? Will be thankful for any example
Priyanka Pradeep 2020-07-17 15:43:13
Jack_rub 2020-07-17 15:29:58
hi i want to save status but not using enum in migration can anybody help me

You can use integer field or string if u are using integer better define the status in the model. Because if you want to change the status value earlier you need to change only in the model

flyingdragons 2020-07-17 16:14:41
Jack_rub 2020-07-17 15:29:58
hi i want to save status but not using enum in migration can anybody help me

Create one more table as status and where you were planning for enum column replace it by foreign_key

flyingdragons 2020-07-17 16:14:53
enums are pain in the ass in longer run
oxbir 2020-07-17 16:20:12
I want to select an option when click edit.

BlogController.php

public function create()
{
$categories = Category::all();
return view(‘Admin.blogs.create’, compact(‘categories’));
}
create.blade.php

<select name=”category” id=”category” class=”form-control”>
@foreach($categories as $category)
<option {{ $category->id == $blog->categories->id ? ‘selected’ : ” }} value=”{{ $category->id }}”>
{{ $category->name_fa }}
</option>
@endforeach
</select>

flyingdragons 2020-07-17 16:20:22
desore 2020-07-17 12:55:50
Hello Guys,
I am new to web development and would like to start with Laravel Framework.

I am using a mac os and have been having issues setting up Laravel on my mac

Hello install MAMP server. If you cant afford MAMP pro then no worries once you install please follow the following article

flyingdragons 2020-07-17 16:20:48
https://stackcoder.in/posts/how-to-setup-mamp-virtual-hosts-for-local-php-development

Setup MAMP Virtual Hosts For Local PHP Development | StackCoderStackCoder
It’s really frustrating to restart the PHP server from the command line while development. In this article, you will learn how to set up Virtual Hosts in MAMP for PHP frameworks like Laravel/Symfony.
oxbir 2020-07-17 16:20:57
oxbir 2020-07-17 16:20:12
I want to select an option when click edit.

BlogController.php

public function create()
{
$categories = Category::all();
return view(‘Admin.blogs.create’, compact(‘categories’));
}
create.blade.php

<select name=”category” id=”category” class=”form-control”>
@foreach($categories as $category)
<option {{ $category->id == $blog->categories->id ? ‘selected’ : ” }} value=”{{ $category->id }}”>
{{ $category->name_fa }}
</option>
@endforeach
</select>

I get this error

oxbir 2020-07-17 16:21:07
Property [id] does not exist on this collection instance.
flyingdragons 2020-07-17 16:22:32
In select there is no access for $blog variable
flyingdragons 2020-07-17 16:23:02
Please pass $blog data too. And along with it pass categories with eager loading
web_artisan77 2020-07-17 16:25:37
is there any faster alternative for composer (Windows) ?
2020-07-17 16:28:06
Guys please suggest the Laravel invoice package
flyingdragons 2020-07-17 16:58:39
web_artisan77 2020-07-17 16:25:37
is there any faster alternative for composer (Windows) ?

You can use a package for faster installation to achieve it. Kindly chek my article

flyingdragons 2020-07-17 16:58:50
https://stackcoder.in/posts/how-to-install-packages-parallel-for-faster-development-in-composer

Install Packages Parallel For Faster Development In Composer | StackCoderStackCoder
One of the major drawbacks of the composer is that it installs the package sequentially ie one by one. Today you will learn how to install hirak/prestissimo which will help the composer to download packages parallel.
flyingdragons 2020-07-17 16:59:40
2020-07-17 16:28:06
Guys please suggest the Laravel invoice package

In invoice what would you like to achieve.

flyingdragons 2020-07-17 16:59:51
Just a sample page?
2020-07-17 17:00:34
No I need to generate invoice for customer
2020-07-17 17:00:56
It is must be customizable
flyingdragons 2020-07-17 17:01:47
I have added article which has almost all the code and even invoice template with PDF download feature. Please check it @
flyingdragons 2020-07-17 17:01:57
https://stackcoder.in/posts/how-to-create-save-download-pdf-from-blade-template-in-php-laravel

Create / Save / Download PDF From Blade Template In PHP Laravel | StackCoderStackCoder
Hola! you amazing people, I am back with a new article. In this article, I will explain you how to create a PDF from a blade template with niklasravnsborg/laravel-pdf package. This package is a wrapper around mPDF.
flyingdragons 2020-07-17 17:02:34
2020-07-17 17:00:34
No I need to generate invoice for customer

Because you wont get any package as per your needs. But if you need open source projects then I can help you

2020-07-17 17:03:01
flyingdragons 2020-07-17 17:02:34
Because you wont get any package as per your needs. But if you need open source projects then I can help you

K bro thanks

2020-07-17 17:03:28
I going to try for DOMpdf Laravel 3rd party package
flyingdragons 2020-07-17 17:04:00
I have used the same in article
flyingdragons 2020-07-17 17:04:12
please reffer it once
2020-07-17 17:04:16
K bro
flyingdragons 2020-07-17 17:04:48
Sorry its Laravel PDF which is wrapper around mPDF. Sorry my bad
Jihat_developer 2020-07-17 17:46:40
Priyanka Pradeep 2020-07-17 15:39:14
Print your collection using dd and see the format

public function show($id)
{
$attributeGroups=AttributeGroup::all();
$cities=City::with(‘province’)->first();
$categories=Category::with(‘childrenRecursive’)->where(‘parent_id’, null)->get();
$cart = Session::has(‘cart’) ? Session::get(‘cart’) : null;
$brands=Brand::inRandomOrder()->get();
$list=Category::findOrFail($id);
$lists=Category::where(‘id’,$id)->get();
$coupons=Coupon::all();

$products=Product::with(‘photos’,’attributeValues.attributeGroup’,’brand’,’categories’)->inRandomOrder()->take(40)->whereHas(‘categories’, function ($query) use($id) {
$query->where(‘category_id’,$id);
})->paginate(12);

if (Auth::check()){
$user=User::findOrFail(Auth::user()->id);
return view(‘frontend.categories.show’,[‘products’=>$products,’categories’=>$categories,’list’=>$list,’lists’=>$lists,’user’=>$user,’cities’=>$cities,’coupons’=>$coupons,’cart’=>$cart,’brands’=>$brands,’attributeGroups’=>$attributeGroups]);
}
else{
return view(‘frontend.categories.show’,[‘products’=>$products,’categories’=>$categories,’list’=>$list ,’lists’=>$lists,’cities’=>$cities,’coupons’=>$coupons,’cart’=>$cart,’brands’=>$brands,’attributeGroups’=>$attributeGroups]);
}

// $lists=Category::where(‘parent_id’,null)->get();
// return view(‘frontend.categories.show’,[‘categories’=>$categories,’lists’=>$lists]);
}

flyingdragons 2020-07-17 19:36:20
Hi has anyone implement AMP pages for blog where the content is dynamically pulled from database. Or if you have any reference kindly share.

Do you suggest me to create sub domain as https://amp.domain_name.com or route prefix with https://domain_name.com/amp/posts/post_url

flyingdragons 2020-07-17 19:38:09
Any help is really appreciate.
|