Cookbook
Integrate phppptx with Laravel
Warning
To run phppptx with Laravel it is mandatory to use the package that supports namespaces. This package is available for Advanced and Premium licenses.
The installation of phppptx in a project that works with Composer can be manual or using a private repository with GitHub, Bitbucket or any other distributed version control system.
In order to use a private repository with GitHub or Bitbucket, you have to generate and use an SSH key:
- GitHub: https://stackoverflow.com/questions/40619393/how-to-add-private-github-repository-as-composer-dependency
- Bitbucket: https://dev.to/minompi/using-a-bitbucket-private-repository-in-your-projects-24j9
To perform a manual integration just follow these easy steps:
- 1- Copy the content of the phppptx package in the folder vendor/phppptx.
- 2- Open the file composer.json. Add the following classmap in the autoload section:
"vendor/phppptx/Classes/Phppptx"
- 3- Update the autoloader of Composer:
Now, with these three easy steps completed, you can work with phppptx.
As an example, let's create a PPTX in a controller, and then save it in the public folder with the name output.pptx: