Adding a php library into laravel 4 - laravel

I'm new to laravel and I would like to ask how to install php markdown library into Laravel 4?
I know how to install a laravel package, but I have no idea on how to install a php file.
Do anyone know how to install it? or using composer?
Library source: http://michelf.ca/projects/php-markdown/

The library is exist on packagist anyway: https://packagist.org/packages/michelf/php-markdown , so you can use composer. Edit composer.json add following line to "require" property:
"michelf/php-markdown": "1.4.*"
run:
composer update
Now you can use it like:
\Michelf\Markdown::defaultTransform($my_text);

Related

Class 'Stripe\Stripe' not found error in PHP

I installed laravel and composer and created my first project in laravel. I want to integrate stripe using PHP. When I try to execute my first project in localhost I take this message:
Fatal error: Class 'Stripe\Stripe' not found in C:\xampp\htdocs\laravel\stripe\public\elda.php on line 21
To include the stripe libraries, I inserted inside the composer.json file the code from the API library for PHP. Here is an image of my composer.json file:
I run composer install in cmd and this is the output:
You may be getting outdated dependencies. Run update to update them.
I run composer update and the output is the error in the image below:
Can someone help me to solve this error?
Well, sorry did not make a comment of your post, but I have not enough points to do so. But you need to run composer install in the terminal after that includes a new package.
I had the same issue, but when I ran this command my issue is resolved.
composer require stripe/stripe-php
I hope this may help you, after you update your composer.

Composer/Laravel: How to add the package moxar/ftp

I need to integrate an ftp library on Laravel 5. I try to add this biblhothèque as shown in the link below.
https://github.com/moxar/ftp
the problem I do not want to make an update to Composer "Composer update" I wonder how I can add only the specified package: "moxar/ftp"
User Composer require command.
composer require moxar/ftp

Laravel Collection installation with Composer and Laravel 5

I need help with a problem.
I'm learning Laravel 5.
And I've found a problem trying to do something.
I tried to install Laravel Collection.
I go to composer.json and I add this line on require:
"laravelcollective/html": "5.1.*"
But when I execute composer update on shell, I have an error:
Your requirements could not be resolved to an installable set of packages.
And a lot of posibles conclusions to the problem.
I put a screenshot to help you to understand.
Actually, the error messages are clear. You are trying to install a package that has a dependency of laravel componenents with a version of 5.1, but in your composer.json file, you imply that your project works with laravel 5.0. Either change the laravelcollective/html version to 5.0.* or change and upgrade your laravel dependency as 5.1.* so that your problem will be solved.

how to safely update way generators 3.0 package in laravel 4.2

i figured out too late that way generators version 3 package is not compatible with laravel version 4.2 it only work with laravel 5, now i need to switch to a previous version of the package and i do not know how to do it properly as my laravel project is in the half way.
Thank you so much for any further help
Update your composer.json file to use "way/generators": "~2.0". Once that is done, run the following command:
composer update "way/generators" --dev
By providing the package name to the composer command, composer will only update the specified package.

Why are there 2 version of Laravel?

I just notice that at Github, there are 2 version of Laravel. One is this: https://github.com/laravel/laravel and the other is https://github.com/laravel/framework. One has more frequent update than the other. For example: one has laravel version 4.1.30 and 4.2.1, but the other one has version 4.1.27 and 4.2.0.
I tried to do composer install & update for laravel 4.1.* on 2 different computer. One give me version. 4.1.30, but the other give me 4.1.27.
Why is that there are two of it? What is the difference?
The first repository link in your question (https://github.com/laravel/laravel) is to build an application using Laravel 4 and you should use this (laravel/laravel) repository if you want to build an application using the Laravel framework.
On the other hand, the second one which is https://github.com/laravel/framework; it's the core code of the Laravel framework and there is a note available in that Github page as given below:
Note: This repository contains the core code of the Laravel framework.
If you want to build an application using Laravel 4, visit the main
Laravel repository.
So, if you want to contribute in the Laravel Framework then clone this repository. This is the core code repository/Laravel Framework (Kernel) and it's laravel/framework not for building an application.
Installation:
For installing the Laravel to build an application you may use:
// Via Composer Create-Project
composer create-project laravel/laravel --prefer-dist
Also you may use this (using Laravel installer and it's faster than composer install):
// Via Laravel Installer
laravel new projectname
For this, you need to download the Laravel installer PHAR archive first. For detail information, check Via Laravel Installer on Laravel website.
The recommended method of installing Laravel is via Composer with the following command:
composer create-project laravel/laravel --prefer-dist
This uses the laravel/laravel repository as the beginning for your project. One of laravel/laravel's Composer dependencies is laravel/framework, which'll get installed to your copy of laravel/laravel's vendor directory along with any dependencies you add yourself.
Everything in laravel/laravel is part of your application code - you'd tweak it, check it into your version control, etc. The stuff in laravel/framework is stuff you use, but don't touch, and it's exempted from version control.
One is the application you'd use as an end user, the other is the core packages which make up the framework.
So when you install laravel/laravel it pulls in the components from laravel/framework into the /vendor directory.

Resources