Download the PHP package urbics/laracivi without Composer
On this page you can find all versions of the php package urbics/laracivi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laracivi
Laracivi - a Laravel 5.5 to CiviCRM bridge
Installs CiviCRM as a package within a laravel project.
Provides civicrm_api3 access to an existing or a new CiviCRM database using a thin api wrapper. Includes console commands to build migrations for all CiviCRM tables from CiviCRM's schema.xml source and seeders from civicrm_data.mysql and civicrm_acl.mysql source, as well as Entity model classes for all CiviCRM tables. Also includes console commands to generate a CiviCRM database directly from civicrm.mysql, and to backup and restore a CiviCRM database. The package uses a lightly modified fork of civicrm-core and unmodified civicrm/civrm-packages.
Package Installation
Or manually by modifying composer.json
file:
Next, add package repository sources to the root composer.json in your project (these components are not currently on packagist):
A few of the civicrm-core dependencies (and the urbics fork of civicrm/civicrm-core) have a dev status, so allow dev packages:
Finally, run composer install
CiviCRM Installation
From your project directory, run
php artisan civi:install
(If you are using homestead or another virtual machine, ssh into the virtual machine before running this)
which will:
- Add a civicrm.settings.php file to
vendor/civicrm/civicrm-core/src
- Move civicrm-packages to
vendor/civicrm/civicrm-core/packages
- Generate civicrm.mysql and related files in
vendor/civicrm/civicrm-core/sql
fromvendor/civicrm/civicrm-core/xml/schema/Schema.xml
source - Add several
CIVI_XXX
settings to the bottom of your project's .env file
then run
php artisan vendor:publish
to bring a civi.php settings file into the config folder.
Next Steps
- Run civi:make:db to create a new civicrm database directly, using CiviCRM's civicrm.msql script.
- Or, run civi:make:migration to generate migration files, optionally with seeder and model classes.
- Build the tables using Laravel's migration:
php artisan migrate --database=civicrm --path=database/migrations/civi --seed
(These are the default settings - change database connection and path as needed)
Limitations and cautions
The civicrm/civicrm-core package has dependencies whose versions may conflict with those in your project. urbics/laracivi has been tested against a clean install of laravel 5.5; more complex projects have had conflicts during composer install
.
civicrm-core uses the PEAR DB class, which conflicts with the DB facade used in Laravel. A solution is to replace use DB;
with use Illuminate\Database\DatabaseManager as DB;
in classes that rely on the DB facade.
Tests
The project includes phpunit tests for each of the console commands as well as for basic api functionality.
All versions of laracivi with dependencies
civicrm/civicrm-core Version dev-master
civicrm/civicrm-packages Version master