Coder Social home page Coder Social logo

Comments (5)

GrahamCampbell avatar GrahamCampbell commented on June 15, 2024

@mimoo You don't need to use a facade if you don't want to. I'd actually recommend against using it.

Example using dependency injection:

<?php

namespace Foo;

use League\CommonMark\CommonMarkConverter;

class Bar
{
    protected $markdown;

    public function __constructor(CommonMarkConverter $markdown)
    {
        $this->markdown = $markdown;
    }

    public function baz()
    {
        return $this->markdown->convertToHtml('markdown goes here');
    }
}

from laravel-markdown.

james2doyle avatar james2doyle commented on June 15, 2024

Facade example:

<?php namespace App\Classes;

use Markdown;

class SomeClass
{
  public function render($string) {
    // once the facade is being "used", call the convertToHtml static method
    echo Markdown::convertToHtml($string);
  }
}

from laravel-markdown.

GrahamCampbell avatar GrahamCampbell commented on June 15, 2024

use Markdown;

I'd always recommend using the FQCN there so you know what it is is actually going on. :)

from laravel-markdown.

KannKhy avatar KannKhy commented on June 15, 2024

Hello GrahamCampbell, when I run composer require graham-campbell/markdown I got error below:
Package socialnorm/socialnorm is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/soundcloud is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/instagram is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/google is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/linkedin is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/github is abandoned, you should avoid using it. No replacement was suggested.
Package socialnorm/facebook is abandoned, you should avoid using it. No replacement was suggested.
Package adamwathan/eloquent-oauth is abandoned, you should avoid using it. No replacement was suggested.
Package adamwathan/eloquent-oauth-l5 is abandoned, you should avoid using it. No replacement was suggeste
d.
Please help me to solve this problem. Thank you!

from laravel-markdown.

GrahamCampbell avatar GrahamCampbell commented on June 15, 2024

Seems unrelated to this package. You have other packages you have installed that are abandoned.

from laravel-markdown.

Related Issues (20)

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.