This repo can be used to scaffold a Laravel package

Overview

:package_description

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


This repo can be used to scaffold a Laravel package. Follow these steps to get started:

  1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton.
  2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
  3. Have fun creating your package.
  4. If you need help creating a package, consider picking up our Laravel Package Training video course.

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require :vendor_slug/:package_slug

You can publish and run the migrations with:

php artisan vendor:publish --tag=":package_slug-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag=":package_slug-config"

This is the contents of the published config file:

return [
];

Optionally, you can publish the views using

php artisan vendor:publish --tag=":package_slug-views"

Usage

$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • Fixed multi-word Vendor or Package name

    Fixed multi-word Vendor or Package name

    • added a slugify and titlecase function:
      • Jack, Jill & Clémence LTD => jack-jill-clemence-ltd
      • Jack, Jill & Clémence LTD => JackJillClemenceLtd
    • use better placeholders so that composer doesn't give the error "./composer.json" does not match the expected JSON schema" (email, vendor_slug, package_slug)
    • default for Author_username now derived from github username
    opened by pforret 15
  • fix renaming files in Windows

    fix renaming files in Windows

    This PR will fix the renaming feature in Windows systems. Windows is using this convention in file paths : D:\testing\file.php while others are using var/www/htdocs/file.php So by fixing the feature, files now will be renamed when executing the configure script.

    opened by koossaayy 6
  • hasMiddleware feature added - See also in laravel-package-tools:featu…

    hasMiddleware feature added - See also in laravel-package-tools:featu…

    Attention: This is the companion PR to the PR "hasMiddleware feature added" in spatie/laravel-package-tools

    This PR implements the default SkeletonMiddleware and the filename replacements in configure.php

    Feature "hasMiddleware" (See PR in laravel-package-tools)

    "This PR adds the feature hasMiddleware to the laravel-package-tools. If added, the middleware automatically runs on each request. This feature allows to apply a middleware globally or only assign it to a specific middleware group."

    Example: ->hasMiddleware(MyMiddleware::class, 'api')

    For a full documentation please see the laravel-package-tools PR.

    opened by camya 4
  • Adding windows support

    Adding windows support

    Hi spatie team

    First of all thank you for this great package 👏

    This package does not work on windows due to missing grep. This pull adresses that using windows available commands.

    Kind regards Carlos

    opened by IGedeon 4
  • Updated the shell script to replace the placeholder values such as

    Updated the shell script to replace the placeholder values such as "skeleton","spatie"

    I've updated the shell script to automatically replace the placeholder values such as "skeleton", "spatie". I've used the generated suggested ClassName ( which was already there ) for replacing Skeleton class name. and added a user input to get the vendor name and replaced it with "spatie". moreover, I 've renamed the files according to the package name. Hope this will save some time.

    opened by irfanm96 4
  • Updated configure.php

    Updated configure.php

    Using a word "Laravel" for your package name is a terrible idea. This PR will prevent it from happening.

    If you create a package and it's name containing a word "laravel", then publishing view files by running php artisan vendor:publish will cause you a problem.

    For example, imagine you created a package named : Laravel-Viewtester. Then package-skeleton-laravel will generate something like LaravelViewtester/src/LaravelViewtesterServiceProvider.php.

    Inside of this generated file will be like this:

    class /LaravelViewtesterServiceProvider extends PackageServiceProvider
    {
        public function configurePackage(Package $package): void
        {
            /*
             * This class is a Package Service Provider
             *
             * More info: https://github.com/spatie/laravel-package-tools
             */
            $package
                ->name('laravel-viewtester')
                ->hasConfigFile()
                ->hasViews();
        }
    }
    

    Now your package is ready and you install this package to new Laravel project by composer for testing. Everything seems OK, then you run php artisan vendor:publish. Your terminal shows that all those providers and tags. But instead of Tag: laravel-viewtester-views you see Tag: viewtester-views.

    How come?

    Because package-skelton-laravel uses laravel-package-tools, it publishes those view files by using these lines of code.

    $this->publishes([
        $this->package->basePath('/../resources/views') => base_path("resources/views/vendor/{$this->package->shortName()}"),
    ], "{$this->package->shortName()}-views");
    

    Now shortName() will remove 'laravel-' prefix from Package name.

    public function shortName(): string
    {
        return Str::after($this->name, 'laravel-');
    }
    

    Although you could publish your package view files, Laravel is not going to use it. Because Laravel tries to search resources/views/vendor/laravel-viewtester/*.blade.php first, but your published views are located in resources/views/vendor/viewtester/*.blade.php instead. So Laravel is not going to find them.

    How this PR will prevent it?

    When you run php ./configure.php and if you use "laravel" in your package name, this PR warns users try not to use "laravel" for your package name.

    Hope this will prevent these mistakes happening again.

    opened by askdkc 2
  • Add Middleware Scaffolding

    Add Middleware Scaffolding

    I saw a previous PR (https://github.com/spatie/package-skeleton-laravel/pull/153) about generating middleware with the skeleton package, and it has an unresolved conflict.

    So, I tried to create a new one with the same logic, and hope this one get merged :)

    opened by ousid 2
  • Fix missing parts in configuration script

    Fix missing parts in configuration script

    There are some missing parts on configuration.php file. I think it's related to #146, the PHP configuration script added instead of the bash script does not do some of the things that the bash script does.

    The problems that I encounter:

    • does not rename migration file
    • does not rename config file
    • does not change skeleton in all files, (it only changes Skeleton but code includes both Skeleton and skeleton)

    I think I fixed all of them but I was using this package first time. So I'm not sure whether the missing parts and all use cases are covered. It would be great if you could check it out, thanks!

    opened by emincanozcan 2
  • feature: allow customising namespace in configure script

    feature: allow customising namespace in configure script

    This pull request adds a new "Vendor namespace" question to the configuration script, allowing you to customise the vendor namespace.

    This is useful for scenarios where the vendor name for the package differs, e.g. I use ryangjchandler for the vendor name but RyanChandler for the namespace.

    opened by ryangjchandler 2
  • Use minimum Testbench 6.19 for fluent package:test usage

    Use minimum Testbench 6.19 for fluent package:test usage

    Before Testbench 6.19

    You need to remember to do the following:

    ./vendor/bin/testbench package:discover
    ./vendor/bin/testbench package:test --parallel
    

    With Testbench 6.19

    No longer need to run package:discover, package:test will always be available when using testbench and no longer accidentally register when using artisan from a Laravel application.

    ./vendor/bin/testbench package:test --parallel
    
    opened by crynobone 2
  • Changing to POSIX compliant sed expression

    Changing to POSIX compliant sed expression

    The \s doesn't work for some implementations of sed.

    On mac, using \s removes 's' from the class name and keep spaces.

    Changing to the POSIX compliant value [[:space:]] fixes it for all.

    Fixes #32 , tested on mac (had issue) and ubuntu (didn't have issue)

    opened by mevtho 2
  • Bump aglipanci/laravel-pint-action from 1.0.0 to 2.1.0

    Bump aglipanci/laravel-pint-action from 1.0.0 to 2.1.0

    Bumps aglipanci/laravel-pint-action from 1.0.0 to 2.1.0.

    Release notes

    Sourced from aglipanci/laravel-pint-action's releases.

    v2.1.0

    Fixing aglipanci/laravel-pint-action#1.

    v2.0.0

    Adding the ability to specify the Pint version on the configuration file.

    Commits
    • 5c0b1f6 Fixing the case of setting the testmode to false.
    • 180ac90 Update README.md
    • 07f4f96 Updating README.md
    • c4b9ef6 Merge pull request #3 from aglipanci/version-based-pint
    • 203c2fe Update entrypoint.sh
    • 9258dcb Update entrypoint.sh
    • 18945b8 adding pint version to actions.yml
    • f8d8a4f dynamic pint version
    • 14b329e removing pint installation from the docker file
    • 17f4cb9 moving pint package installation to the entrypoint
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
Owner
Spatie
We create open source, digital products and courses for the developer community
Spatie
Laravel generator with GUI. Generate crud / scaffold.

Laravel generator with GUI. Generate crud / scaffold.

George 420 Dec 5, 2022
Generator-hedley - Scaffold a headless Drupal backend, Angular app client, and Behat tests

generator-hedley Scaffold a headless Drupal backend, Angular app client, and Behat tests Hedley is a yeoman generator that scaffolds a headless Drupal

null 99 Jun 3, 2022
This repo is for the Laracon 2021 talk "Manage SEO with Laravel and Nova"

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Kristin 7 Dec 9, 2022
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Tinashe Musonza 931 Dec 24, 2022
This Laravel package merges staudenmeir/eloquent-param-limit-fix and staudenmeir/laravel-adjacency-list to allow them being used in the same model.

This Laravel package merges staudenmeir/eloquent-param-limit-fix and staudenmeir/laravel-adjacency-list to allow them being used in the same model.

Jonas Staudenmeir 5 Jan 6, 2023
An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Ian Olson 3 Apr 14, 2021
Renamify is a package for Laravel used to rename a file before uploaded to prevent replacing exists file which has the same name to this new uploaded file.

Renamify Laravel package for renaming file before uploaded on server. Renamify is a package for Laravel used to rename a file before uploaded to preve

MB'DUSENGE Callixte 2 Oct 11, 2022
this package can help you to test race condition in Laravel Feature Test

Laravel Async Testing this package can help you to test race condition in Laravel Feature Test Requirements Laravel versions 5.7, 6.x, 7.x and 8.x PHP

Recca Tsai 61 Nov 5, 2022
This package can use form request just as Laravel do.

Lumen Form Request This package can use form request just as Laravel do. Installation Install by composer $ composer require chhw/form-request In

null 2 Nov 17, 2021
A package can enable DKIM for your Laravel mails.

TobyMaxham Laravel DKIM This package can be used to add a DKIM signature to your outgoing mails. Instead of changing the default Laravel Mailer, Larav

Tobias Maxham 2 Apr 14, 2022
Laravel telegram log is a package that can catch your logs all quite simply

Laravel Telegram log Laravel telegram log is a package that can catch your logs all quite simply. Requirments This package is tested with Laravel v8 i

Muath Alsowadi 4 Aug 3, 2022
you can use this package with your develop operation....

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

Eng Hasan Hajjar 2 Sep 30, 2022
A premade, easy to use local development setup to be used for authoring Laravel applications

Laravel Drydock This project is a premade, easy to use local development setup to be used for authoring Laravel applications. The deliverables of this

Alexander Trauzzi 19 Nov 11, 2022
A collection of classes to be extended/used in laravel apps for quick development

laraquick A collection of classes to be extended/used in laravel applications for quick development. Introduction The library contains traits with wel

Ezra Obiwale 35 Dec 13, 2022
Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Anderson Andrade 4k Jan 6, 2023
Charts - a Laravel library used to create Charts using Chartisan

Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this library attempts to provide more laravel-like features into it by providing support for chart creation using the artisan command, middleware support and routing support.

Mohammad 2 Mar 14, 2022
Prevent users from reusing recently used passwords

Laravel Password History Validation Prevent users from reusing recently used passwords. Installation You can install the package via composer: compose

Paul Edward 67 Oct 10, 2022
A web app for detecting backend technologies used in a web app, Based on wappalyzer node module

About Techdetector This a web fingerprinting application, it detects back end technologies of a given domain by using the node module wappalyzer. And

Shobi 17 Dec 30, 2022
Textpattern-jquery-ui-theme - The jQuery UI theme used within the Textpattern CMS admin-side.

Textpattern jQuery UI theme The jQuery UI theme used within the Textpattern CMS admin-side. Supported web browsers Chrome, Edge, Firefox, Safari and O

Textpattern CMS 12 Jan 10, 2022