Git Product home page Git Product logo

laravel-dismissible-tips's Introduction

Laravel Dismissible Tips

This package allows you to present users with in-context helpful tips that can be dismissed once or permanently.

Installation

Install using composer:

composer require adamthehutt/laravel-dismissible-tips

Then publish assets and other configuration:

php artisan vendor:publish

Run migrations:

php artisan migrate

Make sure to include the relevant css and js files. You can either incorporate them into your existing asset pipeline or reference them directly as:

<link rel="stylesheet" href="/vendor/dismissible-tips/tips.css"/>
<script src="/vendor/dismissible-tips/tips.js"></script>

Icon Library

By default, the dismissible tips assume access to Font Awesome (version 5.9) for icons. If you're already using Font Awesome in your application, then there's nothing else to do. If not, then you have two choices:

  • Install Font Awesome in your layout (free and quick)
  • Use a different icon library, in which case you will need to customize the blade templates accordingly

Configuration

Tips are defined in lang files, e.g.,

/resources/lang/en/vendor/dismissible-tips/en/tips.php

To add a new tip, create a new entry, nested it as deeply as you like:

return [
    'zappa' => [
        'wisdom' => [
            'snow' => "Don't eat the yellow snow!"
        ]
    ]
];

The code above would create a new tip identified as zappa.wisdom.snow.

Use

To use the above tip in a blade template:

@tip(['tip' => 'zappa.wisdom.snow'])

To add an optional link after the tip:

@tip(['tip' => 'zappa.wisdom.snow', 'link' => 'https://example.com/foo/bar'])

Customization

The package publishes its views, css, and javascript in the conventional vendor directories. You can safely customize the look and feel of the tips as much as you like.

laravel-dismissible-tips's People

Contributors

adamthehutt avatar

Watchers

 avatar

Forkers

matlembo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.