• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 10 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Boilerplate template for Laravel 5 packages

Boilerplate Laravel 5 Package

Installation

Clone this repo with minimal history:

git clone --depth 1 [email protected]:cviebrock/laravel5-package-template.git

Rename the directory and re-init it as your own package:

mv laravel5-package-template my-package
cd my-package
rm -rf .git
git init

Configuration

The boilerplate files provide a scaffold for building your own package. You'll need to make a bunch of changes to the files we've provided to make it your own.

composer.json

Edit composer.json to reflect your package information. At a minimum, you will need to change the package name and autoload lines so that "vendor/package" reflects your new package's name and namespace.

{
    "name": "vendor/package",
    ...
    "autoload": {
        "psr-4": {
            "Vendor\\Package\\": "src/"
        }
    },
    ...
},

config/packagename.php

Rename config/packagename.php to something more useful, like config/my-package.php. This is the configuration file that Laravel will publish into it's config directory. Laravel 5 doesn't use the config/packages/vendor/... structure that Laravel 4 did, so pick a file name that's not likely to conflict with existing configuration files.

src/ServiceProvider.php

Open up src/ServiceProvider.php as well. At a minimum you'll need to change the namespace at the top of the file (it needs to match the PSR-4 namespace you set in composer.json).

In the boot() method, comment out or uncomment the components your package will need. For example, if your package only has a configuration, then you can comment out everything except the handleConfigs() call:

public function boot() {
    $this->handleConfigs();
    // $this->handleMigrations();
    // $this->handleViews();
    // $this->handleTranslations();
    // $this->handleRoutes();
}

In the handleConfigs() method, you'll want to change the "packagename" references to the name you chose up above (in the [config/packagename.php] instructions).

For the other methods, again change instances of "vendor" and "packagename" to your package's name.

Last Steps

Update the LICENSE file as required (make sure it matches what you said your package's license is in composer.json).

Finally, edit this README.md file and replace it with a description of your own, awesome Laravel 5 package.

Commit everything to your (newly initialized) git repo, and push it wherever you'll keep your package (Github, etc.).

Enjoy coding!

More Repositories

1

eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel
PHP
3,766
star
2

sequel-pro-laravel-export

A Sequel Pro / Sequel Ace bundle to generate Laravel migration files from existing tables.
PHP
926
star
3

eloquent-taggable

Easily add the ability to tag your Eloquent models in Laravel.
PHP
468
star
4

image-validator

Laravel validator rules for image dimensions - Deprecated; see:
PHP
226
star
5

thumbnailable

Laravel bundle for easy thumbnail handling in Eloquent models, inspired by sfDoctrineThumbnailablePlugin
PHP
35
star
6

eloquent-typecast

Trait for Eloquent models to force type-casting on retrieved values
PHP
23
star
7

laravel-mangopay

Easily integrate the official Mangopay SDK into your Laravel/Lumen applications.
PHP
19
star
8

phpmailer-laravel

PHPMailer bundle for Laravel 3
PHP
17
star
9

VirtualBox-Menulet

Easily launch VirtualBox® machines from your macOS Menubar.
Objective-C
11
star
10

laravel-101-slides

Laravel 101 presentation for the Winnipeg PHP Meetup group
JavaScript
11
star
11

artisan-hash

Adds an Artisan task to Laravel to generate password hashes from the CLI
PHP
9
star
12

gifdown.io

gifdown.io source code
JavaScript
9
star
13

eloquent-loggable

Easy way to track changes to your Eloquent models in Laravel 5.
PHP
7
star
14

php-qrencode

PHP qrencode extension, using libqrencode
7
star
15

eloquent-log-lazy-loading

Quick way to log (or disable) lazy loading relations on Eloquent models.
PHP
6
star
16

opensrs-php

A PHP-based client class that communicates with the TuCows OpenSRS Domain Name Registry System via an API.
PHP
5
star
17

guzzle-stripbom-plugin

Plug-in for Guzzle that strips BOMs from server responses
PHP
5
star
18

laravel-news-sitemap

A Google News sitemap generator for Laravel 4.
PHP
5
star
19

laravel-101

Laravel 101 example project for the Winnipeg PHP Meetup group
PHP
4
star
20

laravel-flasher

Simple message flasher for the Laravel framework
PHP
3
star
21

laravel-elasticsearch

UNMAINTAINED - An easy way to use the official Elastic Search client in your Laravel or Lumen applications
PHP
3
star
22

pastes

The Laravel paste bucket.
PHP
2
star
23

goalfeed

PHP
2
star
24

sandbox

Just some snippets of code
2
star
25

laravel-elasticsearch-handlers

Further easiness when using ES with Laravel
PHP
2
star
26

foundation-filestyle

Better looking HTML file inputs for Zurb Foundation 5
JavaScript
2
star
27

pixie

A simple, on-the-fly image resizing server written in NodeJS.
JavaScript
2
star
28

sluggable

Laravel bundle for easy creation of slugs for your Eloquent models.
PHP
1
star
29

twig-group

Twig filter that splits an array into a given number of groups.
PHP
1
star
30

ScrabbleClub

A website framework to help track players, games and ratings for a Scrabble® club.
PHP
1
star
31

wordlists

Word List generator for games such as Scrabble
PHP
1
star
32

jTextile

A port of the Textile markup system to jQuery
PHP
1
star
33

jquery-equalheights

Equalize heights of containers via jQuery, with additional options
JavaScript
1
star
34

laravel-resources

PHP
1
star
35

twig-natural-join

Twig filter that joins an array using a different separator for the last element (e.g. "John, Mary, Bob and Jim")
PHP
1
star
36

eloquent-replaceable

PHP
1
star