The Code Generation is accessible from the Generate Code tab.
Any Vemto project has the capability to generate the following file types by default:
After adding applications, it is possible to generate the following code for each one:
{info} It is recommended to run the tests with
./vendor/bin/phpunit
inside the project folder after the code generation. It would help you to find bugs or mistakes before starting to implement your own code.
The following modules are currently available for code generation:
When enabled, the "Permissions Module" generates the following code:
When enabled, the "Permissions - API Endpoints Module" generates the following code:
When enabled, the "Auth Scaffold module" will generate the application basic scaffold using the UI template chosen on project creation (Laravel UI, Jetstream, or Breeze).
By default, Vemto generates a Seeder for an Admin user with the following credentials:
The User model receives a method isSuperAdmin()
that is used to check for super-admin capabilities on Policies.
When the permissions module is disabled, a simple array is added to the auth.php
file to identify the super-admins:
<?php
return [
'super_admins' => ['[email protected]'],
// ...
]
If the permissions module is enabled, it adds the following code to the AuthServiceProvider.php
to implicitly grant "Super Admin" role all permissions
Gate::before(function ($user, $ability) {
if ($user->isSuperAdmin()) {
return true;
}
});