PHP 7.0+, database server, and Composer are required.
- There is one ways of grabbing the code:
- Use Git:
git clone git@github.com:laracmf/laracmf.git
- From a command line open in the folder, run
composer install
If you want to use Homestead:
- Run ./vendor/bin/homestead make
- Than run vagrant up && vagrant ssh
- From project root (as usual you can get it by typing cd {project folder name}) under vagrant run bash ./install.sh
Custom database settings, socials credentials and another staff in .env configuration file.
You will need to enter your mail server details into config/mail.php
.
- You can disable verification emails in
config/credentials.php
- Mail is still required for other functions like password resets and the contact form
- You must set the contact email in
config/contact.php
- I'd recommend queuing email sending for greater performance (see below)
To launch site type in your browser address line 192.168.10.10
If you want launch site using specific domain look here.
- You can install all manual, without using install.sh script if you needed
Manual install steps:
- Clone project git clone git@github.com:laracmf/laracmf.git
- Install composer dependencies - composer install
If you want to use Homestead:
- Run ./vendor/bin/homestead make
- Than run vagrant up && vagrant ssh
From a command line open in the folder: 3. Copy config cp config/env/.env.vagrant .env 4. Generate app key php artisan key:generate 5. Generate jwt key php artisan jwt:secret 6. Than run npm install && gulp 7. After all run php artisan app:install
Admin credentials admin@dsmg.co.uk/password
In CMF uses Laravel's queue system to offload jobs such as sending emails so your users don't have to wait for these activities to complete before their pages load. By default, we're using the "sync" queue driver.
- Check out Laravel's documentation.
- Enter your queue server details into
config/queue.php
.
CMF provides caching functionality, and when enabled, requires a caching server.
Note that caching will not work with Laravel's file
or database
cache drivers.
- Choose your poison - I'd recommend Redis.
- Enter your cache server details into
config/cache.php
. - Setting the driver to array will effectively disable caching if you don't want the overhead.
CMF also ships with 18 themes, 16 from Bootswatch.
- You can set your theme in
config/theme.php
. - You can also set your navbar style in
config/theme.php
. - After making theme changes, you will have to run
php artisan app:update
.
CMF natively supports Google Analytics.
- Setup a web property on Google Analytics.
- Enter your tracking id into
config/analytics.php
. - Enable Google Analytics in
config/analytics.php
.
CMF can read CloudFlare analytic data through a package.
- Follow the install instructions for my Laravel CloudFlare package.
- CMF will auto-detect the package, only allow admin access, and add links to the navigation bar.
For this needs we use Socialite package. We provide auth through github. However socialite package offer wide range of socials you can implement. Just follow steps from the doc.
- Users crud.
- Edit configuration from admin page.
- Categories crud.
- Comments management.
- Media crud.
- Pages crud.
To enable comments approvement set COMMENTS_MODERATION
variable to true
in .env file.
To simplify this staff we wrapped Nayjest/Grids package. For advanced options look in package docs.
See demo.
Provided features:
- Render fields;
- Pagination;
- Excel and CSV export;
- Show/hide columns UI control;
- Filtering;
- Refresh;
- Render field with filter;
- Sorting;
- Add callback for customizing field output;
Usage example.
In your template render method add following:
$grid = new GridService();
$user = new User();
$gridComponent = $grid->generateGrid($user, ['first_name' => ['filter' => 'like'], 'last_name', 'email'], ['csv', 'exel', 'recordsPerPage', 'hider', 'refresher']);
view('your_template', compact('gridComponent'));
In template add following:
{!! $gridComponent !!}
How to use:
$grid->generateGrid($user, ['first_name', 'last_name', 'email']);
Options:
- like;
- eq;
- n_eq;
- gt;
- lt;
- ls_e;
- gt_e;
$grid->generateGrid($user, ['first_name' => ['filter' => 'ls_e']);
It will generate input for providing filter options.
Available components:
- csv;
- exel;
- hider;
- refresher;
$grid->generateGrid($user, ['first_name'], ['csv']);
$callback = function ($val, ObjectDataRow $row) {
if ($val) {
return view('partials.names', ['user' => $row->getSrc()]);
}
};
$grid->generateGrid($user, ['first_name' => ['callback' => $callback]);
Example above shows how callback option delegate rights for building first_name view to partial 'names'.
You can set items per page quantity $grid->setPageSize(4);
and grid name $grid->setGridName('Grid name')
.
By default items per page quantity - 15, grid name - 'grid'.
Breadcrumbs feature provides by davejamesmiller/laravel-breadcrumbspackage.
Here is an example how to generate breadcrumb:
Breadcrumbs::register('account.register', function($breadcrumbs) {
$breadcrumbs->push('Registration', route('account.register'));
});
In template add
{!! Breadcrumbs::renderIfExists() !!}
For advanced usage see docs.
To show flash message: flash('Message', 'info')
;
For more options look at this.
We override Mailer class for headers support.
To provide headers in mails just add in .env file for MAIL_SMTP_HEADERS
variable something like this:
MAIL_SMTP_HEADERS='{"PROJECT":"cms", "EMAILS":"your_mail@gmail.com"}'
For minifying css and js files we use gulp.
See here how to use package. It's already implemented. Just run commands in command line.
We use Adminlte.
Run in command line, from project root ./vendor/bin/phpunit
GNU AFFERO GENERAL PUBLIC LICENSE
Laravel CMF Is A PHP CMF Powered By Laravel 5.3 And Sentinel based on Graham Campbell's Bootstrap CMS
Copyright (C) 2017 Nix Solutions
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.