adapt admin panel to handle offerings
This commit is contained in:
		
							parent
							
								
									307954d46f
								
							
						
					
					
						commit
						d3a26a57ac
					
				
					 2 changed files with 27 additions and 0 deletions
				
			
		| 
						 | 
					@ -3,6 +3,7 @@
 | 
				
			||||||
namespace App\Controller\Admin;
 | 
					namespace App\Controller\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\Entity\User;
 | 
					use App\Entity\User;
 | 
				
			||||||
 | 
					use App\Entity\Offering;
 | 
				
			||||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
 | 
					use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
 | 
				
			||||||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
 | 
					use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
 | 
				
			||||||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
 | 
					use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
 | 
				
			||||||
| 
						 | 
					@ -30,5 +31,6 @@ class DashboardController extends AbstractDashboardController
 | 
				
			||||||
        yield MenuItem::linktoRoute('Back to the website', 'fas fa-arrow-left', 'homepage');
 | 
					        yield MenuItem::linktoRoute('Back to the website', 'fas fa-arrow-left', 'homepage');
 | 
				
			||||||
        yield MenuItem::linktoDashboard('Dashboard', 'fa fa-home');
 | 
					        yield MenuItem::linktoDashboard('Dashboard', 'fa fa-home');
 | 
				
			||||||
        yield MenuItem::linkToCrud('User', 'fas fa-user', User::class);
 | 
					        yield MenuItem::linkToCrud('User', 'fas fa-user', User::class);
 | 
				
			||||||
 | 
					        yield MenuItem::linkToCrud('Offering', 'fas fa-seedling', Offering::class);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										25
									
								
								src/Controller/Admin/OfferingCrudController.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/Controller/Admin/OfferingCrudController.php
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace App\Controller\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use App\Entity\Offering;
 | 
				
			||||||
 | 
					use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OfferingCrudController extends AbstractCrudController
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public static function getEntityFqcn(): string
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return Offering::class;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					    public function configureFields(string $pageName): iterable
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return [
 | 
				
			||||||
 | 
					            IdField::new('id'),
 | 
				
			||||||
 | 
					            TextField::new('title'),
 | 
				
			||||||
 | 
					            TextEditorField::new('description'),
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in a new issue