Back to blog

P3 | Exploring Craftable PRO Features: Media, Roles, Permissions, and Localization

Jul 08, 2024
.
Samuel Trstenský

Hi, I’m Samuel from the Craftable PRO team, and in this part of out series, we’re stepping away from the terminal to explore the powerful features Craftable PRO offers. We’ll discuss the Media Library, Roles and Permissions Management, User Access, and Localization to get a deeper understanding of the core functionalities that make Craftable PRO so versatile. Let’s dive in!

Media Library

Media library

Craftable PRO’s Media Manager gives you an organized view of all media uploaded across your models, including images and files added via WYSIWYG editors. If you want to upload media without linking it to a specific model, simply click the “Upload Media” button.

One standout feature in the Media Manager is the built-in image editor. After uploading an image, you can adjust details like Alt text and the picture name. You can even edit the image itself by cropping or rotating it. The Media Manager also lets you filter files by type (image or file) and sort based on model type, collection, format, or disk location.

User Access Management

User Access Management

The Access section in Craftable PRO allows you to manage users specifically for the admin panel. Craftable PRO users are distinct from Laravel users, as they are meant to have administrator-level access. Here, you can invite users by email and assign them roles. The invited user receives an email with a link to complete registration, which can be customized in the configuration files. Options such as two-factor authentication (2FA) and OAuth login via providers like Gmail or Microsoft are also available.

Once registered, users can be modified as needed. You can assign roles, enable or disable 2FA, and update any other necessary details.

Roles and Permissions

Roles and Permissions

Craftable PRO allows you to define custom roles and assign permissions to them. For instance, you could create a “Translator” role that grants access only to Localization. Permissions are granted on a granular level for each CRUD action within every model, ensuring secure and role-specific access.

By default, Craftable PRO provides the Administrator and Guest roles. What’s great is that it automatically generates permissions for newly created models. So, if you add a model like “Post,” permissions for every CRUD operation will appear in the permissions table, streamlining role setup for new features.

Localization

Localization

Craftable PRO makes it easy to add multiple languages to your application. In the Settings menu, you can manage locales, set a default language, and configure the default post-login route for users. Once your locales are set up, the Localization feature allows you to manage translations at the model level and throughout the entire application.

Localization

Craftable PRO includes built-in scanners for JavaScript, PHP, and JSON that detect translatable strings in your code. After a new string is added, you can run a scan to update your database of translatable text. You can then translate each string and publish these translations, which are saved as JSON files to be used in Vue or Blade templates.

To demonstrate, I added a translatable string in our demo project. After rescanning, the text appears in the list of translatable strings, ready for translation. Once I publish, switching the site’s language to French, for example, will display the updated text instantly in that language.


With these features set up, Craftable PRO provides everything you need for secure user management, flexible role permissions, and multi-language support. Now that we’ve covered the essentials, we’re ready to start building the backend for our training app.

Stay tuned for the next part, where we’ll dive into the practical side of creating our app!