Skip to content

Small Laravel 4 artisan command that downloads famous JavaScripts and StyleSheets to your project

License

Notifications You must be signed in to change notification settings

fnnezami/ResGet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ResGet

Small Laravel 4 artisan command that downloads famous JavaScripts and StyleSheets to your project

*Resget now can minify your scripts for you.

Installation

Simply download resget-install.sh and copy it to your laravel project root directory. Now run it with php as following format, it will download all needed files and set laravel settings for you.

php resget-install.sh

Usage

  1. adding resource

    after resget command add your desired resources with --resname or -r currently resget supports following resources

    • Jquery Library -r=jqury or -r=$
    • UnderscoreJS Library -r=underscore or -r=_
    • BackBoneJS Library -r=backbone or -r=bb

      *Using BackBone will automatically add jquery and underscore to your library

    • AngularJS Library -r=angular or -r=ang
    • Twitter Bootstrap 3 -r=bootstrap3 or -r=tb3

      *This will add both bootstrap's stylesheet and script

    • Font Awesome Library -r=fontawesome or -r=fa
    *I am currently working on creating a repo for scripts and stylesheets so after that you can save and share your favorite stylesheet or script on the repo and everyone can get it with ResGet. Stay tuned :D ResGet will automatically creates /js , /font , /img and /css for you under your public directory and save resources there for those users who perfer custom public directory beside laravel public directory they can choose directory by --approot= or -a= the preset is laravel public directory.
    following line is a sample code downloading many resources in a custom directory
    php artisan resget -r=backbone -r=tb3 -r=fa -a=php

  2. Merging and minifying your scripts

    You can merge and minify your java scripts with ResGet. ResGet utilize a small php tool written by Ryan Grove names jsmin-php. ResGet Installer automatically downloads it and saves it under app/storage/vendor/jsmin.php , it will creates vendor folder for you if it does not exist.
    To minify your code you have tell resget that you want to minify by using minify command after resget. you have to give it a name with --name= and give the path to your script files with --path or -p switches you can also use --approot or -a for a custom public directory it will create the minified version for you under the /js folder in your selected public directory. here is a sample of its usage:
    php artisan resget minify -p=/home/1.js -p=/home/2.js --name=myjs -a=php

Here is the complete command list of ResGet:

command / switch Description How to use
info Shows developer information php artisan resget info
version show your ResGet version php artisan resget version
minify Tells ResGet you want to minify scripts php artisan resget minify --name={name} -p={path/to/script} -p={path/to/script} ... [-p={path/to/custom/public/folder}]
--resname | -r you can choose libraries by setting thier names with this command you can choose [jqurey | $ | underscode | _ | backbone | bb
angular | ang | bootstrap3 | bt3 | fontawesome | fa ]
php artisan resget -r=ang -r=_ -r=$ ....
--approot | -a [default = public] you can choose a custom public folder php artisan resget -r=$ -r=_ ... -a={custom/public/folder}
php artisan resget minify -n={myjs} -p={path/to/js} -p={path/to/js} ... -a={custom/public/folder}
get [currently not available] it will get a custom js from my repo uploaded and shared by others. I am still working on it. N/A

License

This Tool is under MIT license feel free to use it, share it and develope it :D

About

Small Laravel 4 artisan command that downloads famous JavaScripts and StyleSheets to your project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages