Pass new parameters
This commit is contained in:
20
app/Exports/Botanic/Families.php
Normal file
20
app/Exports/Botanic/Families.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||||||
|
|
||||||
|
use App\Models\Botanic\Family;
|
||||||
|
|
||||||
|
class FamiliesExport implements FromQuery
|
||||||
|
{
|
||||||
|
use Exportable;
|
||||||
|
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
return Family::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
20
app/Exports/Botanic/Genres.php
Normal file
20
app/Exports/Botanic/Genres.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||||||
|
|
||||||
|
use App\Models\Botanic\Genre;
|
||||||
|
|
||||||
|
class GenresExport implements FromQuery
|
||||||
|
{
|
||||||
|
use Exportable;
|
||||||
|
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
return Genre::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
20
app/Exports/Botanic/Species.php
Normal file
20
app/Exports/Botanic/Species.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||||||
|
|
||||||
|
use App\Models\Botanic\Specie;
|
||||||
|
|
||||||
|
class SpeciesExport implements FromQuery
|
||||||
|
{
|
||||||
|
use Exportable;
|
||||||
|
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
return Specie::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
20
app/Exports/Botanic/Varieties.php
Normal file
20
app/Exports/Botanic/Varieties.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||||||
|
|
||||||
|
use App\Models\Botanic\Variety;
|
||||||
|
|
||||||
|
class VarietiesExport implements FromQuery
|
||||||
|
{
|
||||||
|
use Exportable;
|
||||||
|
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
return Variety::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,9 @@ namespace App\Http\Controllers\Shop;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Articles;
|
||||||
|
use App\Repositories\Shop\Categories;
|
||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -24,6 +27,10 @@ class HomeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('Shop.home');
|
$data['categories'] = Categories::getTree();
|
||||||
|
$data['articles'] = Articles::getByCategory(0)->toArray();
|
||||||
|
dump($data);
|
||||||
|
exit;
|
||||||
|
return view('Shop.home', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,12 @@ class Shop
|
|||||||
$menu->addTo('shop', 'Tags', [ 'route' => 'Shop.Admin.Tags.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Tags', [ 'route' => 'Shop.Admin.Tags.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.Tags.*'])->order(7);
|
->activeIfRoute(['Shop.Admin.Tags.*'])->order(7);
|
||||||
|
|
||||||
|
/*
|
||||||
$menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(8);
|
->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(8);
|
||||||
$menu->addTo('shop', 'Stock', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Stock', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(9);
|
->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(9);
|
||||||
|
*/
|
||||||
$menu->addTo('shop', 'Prix génériques', [ 'route' => 'Shop.Admin.ArticlePriceGenerics.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Prix génériques', [ 'route' => 'Shop.Admin.ArticlePriceGenerics.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.ArticlePriceGenerics.*'])->order(10);
|
->activeIfRoute(['Shop.Admin.ArticlePriceGenerics.*'])->order(10);
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ class Articles
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getByCategory($category_id)
|
||||||
|
{
|
||||||
|
return Article::with(['prices.article_attribute.attribute_value'])->get();
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCategoriesByArticle($article)
|
public static function getCategoriesByArticle($article)
|
||||||
{
|
{
|
||||||
return $article->categories->pluck('id')->toArray();
|
return $article->categories->pluck('id')->toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user