1.0.3 2018-03-14 15:39 UTC


Adding project to Packagist

  1. Visit https://packagist.org/packages/submit
  2. Paste your public clone url in (ie: https://git.hejazi-far.com/web/laravel-framework.git)
  3. Click Submit to generate the project
  4. In Gitlab, go to your project settings integrations and click on Packagist
  5. Put in your Username, token, and https://packagist.org for the Server
  6. Make sure the Active checkbox is on, and Push, Merge requests, and Tag pushes are all turned on and then Save

To push an update to Packagist

  1. Run git log --pretty=oneline to view your commits
  2. Grab the commit identifier, and then run git tag 1.0.0 e0113ba0044706a7bd88d77908f3d01da682a631 to tag your commit
  3. Run git push --tags to send your changes to the server
  4. Wait 1-5 minutes for Packagist to receive the changes

Creating a new project using this framework

laravel new my-application
cd my-application
composer require hejazi/laravel-framework 1.0.*
php artisan hejazi:init -e 'test@gmail.com' -p 'MyP@ssword'

You'll need to fill in your database and email settings in the .env file, and then:

php artisan migrate:fresh --seed

You should now have a freshly installed application that you can use to log in and out, as well as reset passwords.

An account will already be created for you that you can login with using the email you provided to the hejazi:init command, and 'secret' as the password.

Adding an enum + endpoint

If you want an enum with the following structure:

class Gender {
    const MALE = 1;
    const FEMALE = 2;

Then you would run the following command:

php artisan hejazi:make:enum Gender -c "MALE,FEMALE,OTHER"

The above command will generate a model, controller, migration, factory, and seeder. You will then need to migrate your database to create the table and fill the data for the enum:

php artisan migrate
php artisan db:seed --class=GendersTableSeeder

Developing/Modifying this framework

You'll need to create a Laravel project and import this framework into it:

mkdir ~/projects
cd ~/projects
git clone ssh://git@git.hejazi-far.com:8002/web/laravel-framework.git
laravel new my-application
cd my-application
composer require hejazi/laravel-framework "dev-master"
nano composer.json

Add the following changes to my-application's composer.json file:

  "repositories": [
      "type": "path",
      "url": "/Users/username/projects/laravel-framework"

Run the following to create the symlink:

composer update hejazi/laravel-framework
composer dump-autoload

You can now modify the hejazi/laravel-framework files in your my-application project directly in the vendor folder.