https://github.com/42coders/the-laravel-admin-panel
A Laravel admin panel which is creating CRUD for your application automatically.
https://github.com/42coders/the-laravel-admin-panel
admin-dashboard admin-panel hacktoberfest laravel laravel-package php
Last synced: 5 months ago
JSON representation
A Laravel admin panel which is creating CRUD for your application automatically.
- Host: GitHub
- URL: https://github.com/42coders/the-laravel-admin-panel
- Owner: 42coders
- License: mit
- Created: 2021-09-20T09:42:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-09T12:30:10.000Z (over 3 years ago)
- Last Synced: 2025-07-15T11:32:31.871Z (11 months ago)
- Topics: admin-dashboard, admin-panel, hacktoberfest, laravel, laravel-package, php
- Language: JavaScript
- Homepage:
- Size: 3.1 MB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Adds a zero configuration Admin Panel to your Laravel Application
[](https://packagist.org/packages/the42coders/the-laravel-admin-panel)
[](https://travis-ci.org/the42coders/the-laravel-admin-panel)
[](https://scrutinizer-ci.com/g/the42coders/the-laravel-admin-panel)
[](https://packagist.org/packages/the42coders/the-laravel-admin-panel)
## Installation
You can install the package via composer:
```bash
composer require the42coders/the-laravel-admin-panel
```
You need to register the routes to your web.php routes File as well. Since the-laravel-admin-panel Package is very powerful make sure to secure the routes with whatever authentication you use in the rest of your app.
```php
Route::group(['middleware' => ['auth']], function () {
\the42coders\TLAP\TLAP::routes();
});
```
You need to publish the assets of the Package
```bash
php artisan vendor:publish --provider="the42coders\TLAP\TLAPServiceProvider" --tag=assets
```
Other publishable Contents are
config
```bash
php artisan vendor:publish --provider="the42coders\TLAP\TLAPServiceProvider" --tag=config
```
language
```bash
php artisan vendor:publish --provider="the42coders\TLAP\TLAPServiceProvider" --tag=lang
```
views
```bash
php artisan vendor:publish --provider="the42coders\TLAP\TLAPServiceProvider" --tag=views
```
## Usage
To generate the CRUD for a Model just add the TLAPAdminTrait to your Model.
``` php
use the42coders\TLAP\Traits\TLAPAdminTrait;
class User extends Model
{
use TLAPAdminTrait;
```
and register it in the config tlap.php.
``` php
'models' => [
'users' => 'App\Models\User',
]
```
Now you can just visit the url of https://your-website.de/admin.
You can change the url under which the admin panel will be accessible
in the tlap.php config file with the path variable.
This package autoload your relations if you use return types on them.
``` php
public function posts(): HasMany
{
return $this->hasMany('App\Models\Post');
}
```
The package is guessing your application by its Database structure.
Including validation. But you can overwrite this guessing by your own wishes.
You only need to add the static function fields to your Model and set the
$fields array with your Field definitions. This is the area which might change
a little before the final release.
``` php
public static function fields()
{
self::$fields = [
new TextField('name', 'Name'),
new TextField('slug', 'Slug'),
new TextField('description', 'Description', false),
new TextField('menu', 'Menu'),
new TextField('image', 'Image'),
new TextField('parent_id', 'Parent ID'),
];
return self::$fields;
}
```
By now we have the following Fields out of the box.
Field | Description
---- | -----------
Checkbox | Default bs5 Checkbox
File | Default bs5 Filepicker
Select | Default bs5 Select field
Text | Default bs5 text input field
TextField | Default bs5 Textarea.
In the future it will be possible to add your own Fields as well.
### Testing
``` bash
composer test
```
### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email max@42coders.com instead of using the issue tracker.
## Credits
- [Max Hutschenreiter](https://github.com/max-hutschenreiter)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).