Download the PHP package sectheater/artify without Composer

On this page you can find all versions of the php package sectheater/artify. 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 artify

StyleCI

SensioLabsInsight

Latest Version on Packagist

Total Downloads

Made with ❤️ by SecTheater Foundation

Artify CheatSheet will be availble soon


Laravel is a great framework and it provides us the ability to create our custom artisan commands, so why not to have a couple of commands that makes your life easier while develping your application.

If you have any inspiration about a new command , or you do something routinely and you want a command for that , Please do not hesitate at all.

Artify cares about the commands that you should have within your application, for now, it ships with commands that will help you to create files that laravel don't supply a command for them till now such as Repositories,Observers,Responsable Interface,facades and so on..

Installation Steps

1. Require the Package

After creating your new Laravel application you can include the Artify package with the following command:

If your laravel version is 5.5+, you don't need to register ArtifyServiceProvider as It"s automatically discovered, unless that you got to register it manually in your config/app.php

2. Add the DB Credentials & APP_URL

Next make sure to create a new database and add your database credentials to your .env file:

3. Getting Your Environment Ready.

Just Run The following command.

Command Interpretation

1- It publishes the roles migrations,its seed, and the config file that artify will use.

2- "-c" stands for the caching whether to enable or not, 20 stands for the number of minutes that's going to be cached.

If you don't want to enable the cache just remove the -c and the number to become like that

3- It asks about the Role model, and the permissions column which will artify handle during the generating files related to roles.

Artify Provides you the ability to set your custom namespace and your custom user model within config/artify.php

Installation Preview

Now everything is set, Let's dive into the Commands.

4. Commands that artify covers.


4.1 Create an Observer

Observer is typically observing for a particular eloquent event. On happening this event, Observer is fired, You can read about it at the documentation.

The upon command generates an observer file within your App/Observers with name of PostObserver The methods there now have Post Model as parameter passed, The ignored methods while creating the observer ( which won't be within this file) are created and updated.


4.2 Create A Responsable Interface

Responsable Interface is a Laravel 5.5 feature that you should use to make your controller slim, you can see a tutorial about it.

The command upon is going to create you a new file with the name you attached under App/Responses


4.3 Synchronozing Your Roles table with Policy & Gates

This command is in charge of converting the available roles within your database into policy and gates

It's preferable to follow the convention of naming the roles as mentioned in the Roles Table Seeder

Artify also supplies you with the migration for roles, if you are going to change the permissions column, don't forget to update that within the config file

Permissions column should be an array, if they are jsonb in your database, use the accessors, or observers, or use casts property to convert permissions to an array

By Default this command requires the hasRole method ( it should return boolean ) , you can create your custom one within user model, or just import the Roles trait

This method is required to check whether the user has a specific role to access somewhere or not, It's used within the gates. Feel free to change the gates"s logic to suit your needs.

By Firing this command, you can use the can middleware anywhere within your route file

also you can access the method can anywhere in your project.


4.4 Assign User To A Specific Rank.

This command is just there to save you a couple of minutes whenever you assign a user manually to a specific role through database.


4.5 Create A Repository

Repository patten is absolutely a powerful pattern that you should use in order to separate logic from your database layer ( model ) and keep your model cleaner.


4.6 Generate a facade.


4.7 Generate CRUD

Well, This artifier is really a beast, it could save you up to 20 minutes or something , It helps you to generate the following


4.8 ADR Installation

You may know the ADR pattern, out of the blue artify supports this pattern, It's an alternative of MVC that we personally think it's better, if you don't know much about it yet, we recommend you getting started with this link , If you a tutorial fan, you can see this course

This command actually sets up the environment by publishing the standards of adr inside your App\App directory, which will create the directory in case you don't have it.


4.9 ADR Generation

This command is actually powerful as it ships with various options consisting of

This is going to create you Addresses folder under the app directory and will look like the following structure :

├── App

├── Addresses   

│   ├── Actions    

│   │   ├── IndexAddressAction.php

│   ├── Domain

│   |   ├── Services

|   |      ├── IndexAdressService.php

│   ├── Responders

│   |   ├── IndexAddressResponder

└── ...

Which in essence creates you Action, Service, Responder.

You can also model, associated with the repository and migration

Note that passing the filename in this case will be ignored, as the domain is only our main concern in this case, anyways this will generate you the repository, model, migration and the factory.

You can also create a resource for this domain using the -c option.

You can also combine them all at once using the -A option.

This will create you Responder,Action, and Domain components.

Note that action,responder,service will contain of IndexVideo file only, for creating other files, use the command again and mention their names again.

5.0 Roles Trait

This trait is there to handle the authorization process for artify commands , but feel free to use it for your own purposes. It contains of a few methods that"s really helpful for you to handle authorization anywhere within your application. Let"s dive into the Methods there.

The Trait supports checking roles within your roles table and the users table ( secondary permissions to be assigned for users )

Authorization Methods.

1.0 hasRole Method

This method accepts only one argument and it should be string, the string should match a role name within your permissions column either on users table or roles table.

The method is going to search for the permission associated with the user either on roles table or users table.

2.0 hasAnyRole Method

I think you"ve guessed what"s going on here, It searches for all of the roles you pass and returns true on the first role that a user may have

3.0 hasAllRole Method

This method accepts one argument, it should be an array containing of the permissions you are checking for.

This method checks on all the roles passed, whether the user has them all or not.

3.0 inRole Method

This method checks if the user"s rank is typically equal to the passed argument.


Permissions Handling Methods.

The permissions are assigned to the current user you are working on only. i.e you can retrieve the user by finding him/her or get the authenticated user then handle his/her permisisons.

1.0 Add Permission

This method accepts two arguments which are the permissions and boolean value.

2.0 Update Permission

This method accepts three arguments

3.0 Remove Permission

This method accepts one argument only representing the permission

For Further Resources, Here is an article on [medium] : https://medium.com/@secmuhammed/the-missing-laravel-commands-have-arrived-e0db7092cf07


All versions of artify with dependencies

PHP Build Version
Package Version
No informations.
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 sectheater/artify contains the following files

Loading the files please wait ....