Jul 23, 2024
laravel new lara_admin_panel
cd lara_admin_panel
php artisan serve
php artisan migrate
lara_admin_panel
phpMyAdmin
Open Admin
package:
composer require open-admin-org/open-admin
php artisan vendor:publish --provider="OpenAdmin\ServiceProvider"
php artisan admin:install
/admin
in browser and login using admin credentialsOpen Admin Helper
for easier setup:
composer require open-admin-ext/helpers
php artisan admin:import helpers
Helpers
menu optionScaffold
option to create tables, models, and controllers:
students
name
, email
, image
app/admin/routes.php
Route::resource('students', 'StudentController');
config/filesystem.php
:
'admin' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL').'/uploads',
'visibility' => 'public',
],
APP_URL
in .env
file to match the server URLStudentController.php
to show images
$grid->column('image')->display(function ($image) {
return "<img src='/uploads/{$image}' width='50'/>";
});
Scaffold
for existing tables (e.g., users
)