Download the PHP package samiksengupta/laravel-admin without Composer

On this page you can find all versions of the php package samiksengupta/laravel-admin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-admin

Laravel Admin

Latest Version on Packagist Total Downloads GitHub Actions

A quick way to set up an admin panel, API endpoints and routing for a Laravel project. You can use this package to add the following features to your project.

Installation

You can install the package via composer:

Usage

Setting Up the Admin Panel

After the package is installed in your project and you have configured your Database connection in your .env file, run the following command:

This will publish the required configuration, assets and seeders from this package to your project and run migrations and seeders.

If you do not wish to run the seeders and would rather do it manually, you can use the --empty option when installing.

If you wish to forcibly overwrite all files, you may use the --force option when installing.

If you have recently updated Laravel Admin package, you may use the --update option when installing. This will only overwrite assets and seeders and skip some options entirely.

Note: If you are not using the --update option when installing, you will be prompted to replace the database/seeders/DatabaseSeeder with the one that comes with LaravelAdmin. It is recommend you do this when installing Laravel Admin for the first time, as it will make running seeders easier with the php artisan db:seed command.

Default Roles and Users

By Default, Laravel Admin installs two Roles Dev and Admin. Dev is an unrestricted Role and ignores all permission settings (can access everything). Admin is given most administrative permissions not involving some super-level permissions that manages Admin Panel critical data such as deleting Settings and running Commands. Dev can grant Admin any permissions if they want and Admin can pass on whatever permission they have to any other new Roles that are created afterwards.

If you did not use the --empty option when installing, a default Dev User is also created for initital login. The following credentials can be used to login.

Role Username Password
Developer dev 123456

Under the same install conditions, you will be asked if you want to create an Admin user if none exists. If you proceed, the basic user data will need to be provided to continue.

Extending the Laravel Admin User Model and generating a Policy

When not installing with the --update option, the install script will automatically try to set the default Laravel User Model (App\Models\User) as a child to the User Model (Samik\LaravelAdmin\Models\User) provided by Laravel Admin and then generate a Policy for this User model. If this process fails for some reason, you will need to do this manually and also generate a Policy for everything to work seamlessly.

To do this, you can change the User model to extend the Laravel Admin's User Model:

And then generate an UserPolicy with the following command:

If the App\Policies\UserPolicy somehow exists before this, it won't get created or replaced. You will then need to ensure that the policy class extends Laravel Admin's Crud Policy (Samik\LaravelAdmin\Policies\CrudPolicy) class:

Creating Admin Panel Modules

A module is simply a set of Model, Migration, Controller and Policy files that work togather to represent your data in the admin panel. You can create all these files in one go by using the command:

This will create a new Model class, a new Migration for the model's database table, a Controller and a Policy in their respective locations. You can edit the newly created Migration file to add whatever columns you want and then run migration to generate the table with the columns in them.

What sets these Classes apart from Laravel's own Model/Controller/Policy Classes is that they extend Laravel Admin's Base Classes that add extra functionality for CRUD operations, Validation, Filter Generation, DataTable Response Generation and a lot more.

If you want to quickly generate default CRUD permissions for this Model and a Menu Item entry for accessing the corresponding web route that will take you to the Model's listing page you can use the following command:

This will update the database/data/permissions.json and database/data/menu-items.json files which will then be used to run the seeders to populate the database.

If you want to skip seeding initially you can omit the --seed option and then make adjustments to these JSON files and run:

for seeding the Permissions manually (using an updateOrCreate operation)

for seeding the MenuItems manually (using a Truncate and Insert operation)

If you run these commands, you can expect to have:

Using the HasFileUploads Trait

Laravel Admin comes with a Trait that automatically handles file uploads and deletions. Use the Samik\LaravelAdmin\Traits\HasFileUploads trait in your model and specify the location where files will be stored, and the model will store the file upon being created. Upon being deleted or updated, the older stored files will be deleted as well.

In this example, the model will expect a field input named 'myfile' as part of the request. Base64 encoded fields will also be handled by this trait. In the $uploadFields configuration if a folder is not specified, a folder named uploads will be assumed. All files that are uploaded will be stored in a sub-folder inside the specified folder grouped by the current Year and Month to make folder navigation easier.

If the file gets uploaded but you cannot access it via urls, try to generate the symbolic links:

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of laravel-admin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0
spatie/laravel-html Version ^3.2
tymon/jwt-auth Version ^2.0
yajra/laravel-datatables-oracle Version ^10.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package samiksengupta/laravel-admin contains the following files

Loading the files please wait ....