Permalink
Browse files

Upgraded to Laravel 5.5

  • Loading branch information...
bpocallaghan committed Oct 15, 2017
1 parent b4f4f9e commit 37199a02e9b8b5e3b85123dc411d451cfa2c6a6a
Showing 365 changed files with 26,744 additions and 9,945 deletions.
@@ -1,13 +1,13 @@
APP_NAME="Laravel Starter"
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_URL=http://admin-starter.dev
APP_DESCRIPTION="Laravel Starter with AdminLTE theme"
APP_AUTHOR="Ben-Piet O'Callaghan"
APP_KEYWORDS="laravel titan starter project admin adminlte"
APP_DESCRIPTION="Example Description"
APP_AUTHOR="Example Author"
APP_KEYWORDS="laravel"
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
@@ -25,24 +25,19 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=log
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME="Laravel Admin"
MAIL_FROM_NAME="Admin Starter"
MAIL_FROM_ADDRESS=noreply@example.com.na
MAIL_ADMIN_EMAILS="bpocallaghan@gmail.com"
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
FACEBOOK_APP_ID=null
RECAPTCHA_PUBLIC_KEY=null
RECAPTCHA_PRIVATE_KEY=null
GOOGLE_ANALYTICS=null
GOOGLE_MAP_KEY=null
ANALYTICS_SITE_ID=null
ANALYTICS_SERVICE_EMAIL=null
FACEBOOK_APP_ID=
RECAPTCHA_PUBLIC_KEY=
RECAPTCHA_PRIVATE_KEY=
GOOGLE_ANALYTICS=
GOOGLE_MAP_KEY=
ANALYTICS_SITE_ID=
ANALYTICS_SERVICE_EMAIL=
@@ -8,9 +8,15 @@
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpstorm.meta.php
.env.live
.env.stage
_ide_helper.php
.phpstorm.meta.php
public/mix-manifest.json
public/uploads/
resources/assets/images/home/
resources/assets/images/fancy/
resources/assets/js/vendor/jquery-2.2.2.js
storage/google-analytics.p12
.env.live
@@ -1,37 +1,32 @@
# Laravel CMS Starter Project
A Laravel CMS Starter project with AdminLTE theme and core features.
- Laravel 5.4
- Laravel 5.5
- Laravel 5.4 (Branch Laravel 5.4)
- Laravel 5.2 (Branch Laravel 5.2)
[Preview project here](http://bpocallaghan.co.za/admin)
[Preview project here](http://bpocallaghan.co.za)
- User: github@bpocallaghan.co.za
- Password: github
### What is New?
- [Impersonation](https://github.com/bpocallaghan/impersonate) When logged in, [go here](http://bpocallaghan.co.za/admin/settings/admin/users) and click on the 'impersonate user' action.
- Roles (Assign a role to user and assign role to navigation. Can only see navigation for given role)
- Upgraded to Laravel 5.5 and added many new 'components (blog, news, banners, etc)'
- Page Builder (CRUD website pages with 3 different components)
## Features / What it includes
- Admin LTE admin theme
- Authorization
- login / forgot password
- register via authorization (admin invite user)
- Members (website and admin users)
- Google Analytics Reports (with charts)
- visitors
- devices
- keywords
- pages
- Admin Navigation
- Website Navigation
- Website Page Builder
- Log Website Activities (if contact us was submitted, etc)
- Notifications (Laravel 5.4 notifications)
- Notifications (Laravel notifications)
- Log Admin Activities (when admin create,edit,delete a resource)
- Bootstrap Alerts and Form Error messages. package; bpocallaghan/alert
- Flash a Notification after a CRUD resource action. package; bpocallaghan/notify
- Generate crud resource, individual files. package; bpocallaghan/generators
- Impersonate any of your customers
- Roles, Assign roles to the user and navigation to exlude navigation for a user.
- Manage Blog, Banners, FAQ, Photos and many more.
## Setup (Basic)
- download zip
@@ -42,12 +37,9 @@ A Laravel CMS Starter project with AdminLTE theme and core features.
- create your database and set db name in .env
- ```php artisan migrate```
- ```php artisan db:seed```
- open database\seeds\UserTableSeeder.php to create a different admin
- open your browser (http://laravel-admin.dev/)
- the home, about, contact us gets generated + the breadcrumb
- log into the admin (http://laravel-admin.dev/admin)
- admin@laravel-admin.dev
- admin
- open database\seeds\UserTableSeeder.php to enter your admin user
- open your browser (http://laravel-admin.dev)
- log into the admin (http://laravel-admin.dev/admin) with your admin user
## Setup (Advanced)
- complete 'basic' setup
@@ -72,7 +64,15 @@ A Laravel CMS Starter project with AdminLTE theme and core features.
## Admin LTE
If you would like to change the default skin.
Please have a look in `webpack.mix.js` Line ~100 and uncomment the desired skin.
Please have a look in `webpack.mix.js` Line ~110 and uncomment the desired skin.
Please also remember to update the skin's name in `'views\layouts\admin.blade.php'` - `<body class="skin-blue">`
## TODO
- Move the 'core' files to the titan package
- Move the admin 'components' to packages (The idea is to have Banners, Testimonials, Blog, etc in seperate packages to include when needed)
- Update website style
- Unit Testing
- Vuejs
## Thank you
@@ -83,7 +83,7 @@ Please have a look in `webpack.mix.js` Line ~100 and uncomment the desired skin.
## Note
Please keep in mind this is for my personal workflow and might not fit your need.
This is my starter project for most small crud admin portals.
This is my starter project for most crud admin portals.
I try to keep it clean, flexibly and friendly to use. This is not a complete project or best practises, just trying to help the community :).
Please let me know about any issues or if you have any suggestions.
@@ -29,12 +29,14 @@ protected function schedule(Schedule $schedule)
}
/**
* Register the Closure based commands for the application.
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
@@ -16,5 +16,7 @@ public function __construct(FeedbackContactUs $row)
{
$row->type = 'Contact Us';
$this->eloquent = $row;
log_activity('Contact Us', "{$row->fullname} submitted a contact us.", $row);
}
}
@@ -0,0 +1,42 @@
<?php
namespace App\Events;
use App\Models\UserInvite;
use App\User;
use Carbon\Carbon;
use App\Models\Role;
use Illuminate\Queue\SerializesModels;
use App\Notifications\UserRegistered as NotifyUserRegistered;
class UserRegistered
{
use SerializesModels;
/**
* Create a new event instance.
* @param User $user
* @param null $token
*/
public function __construct(User $user, $token = null)
{
$roles = [Role::$WEBSITE];
// if token - add admin role and mark as claimed
$userInvite = UserInvite::whereToken($token)->whereNull('claimed_at')->first();
if ($userInvite) {
$roles[] = Role::$ADMIN;
// set invite claimed
$user->update(['gender' => 'male']);
$userInvite->update(['claimed_at' => Carbon::now()]);
}
// attach the roles to the user
$user->syncRoles($roles);
// notify / send email to user to confirm account
$user->notify(new NotifyUserRegistered());
log_activity('User Registered', $user->fullname . ' registered as a new user.', $user);
}
}
@@ -3,23 +3,27 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
@@ -46,20 +50,4 @@ public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}
return redirect()->guest(route('login'));
}
}
@@ -0,0 +1,22 @@
<?php
use App\User;
use App\Models\Role;
if (!function_exists('notify_admins')) {
function notify_admins($class, $argument, $forceEmail = "")
{
if (strlen($forceEmail) >= 2) {
$admins = User::where('email', $forceEmail)->get();
}
else {
$admins = User::whereRole(Role::$ADMIN)->get();
}
if ($admins) {
foreach ($admins as $a => $admin) {
$admin->notify(new $class($argument));
}
}
}
}
@@ -0,0 +1,8 @@
<?php
if (!function_exists('photo_url')) {
function photo_url($name)
{
return config('app.url') . '/uploads/photos/' . $name;
}
}
@@ -6,9 +6,32 @@
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Validation\ValidationException;
use Titan\Controllers\TitanAdminController;
class AdminController extends TitanAdminController
{
/**
* Generate a filename and try to move the file
* @param $attributes
* @return string
* @throws ValidationException
*/
protected function moveDocument(&$attributes)
{
// get and move file
$file = $attributes['file'];
$filename = token() . '.' . $file->extension();
$file->move(upload_path('documents'), $filename);
unset($attributes['file']); // remove from attributes
if (!\File::exists(upload_path('documents') . $filename)) {
$validator = \Validator::make([], ['file' => 'required'],
['file.required' => 'Something went wrong, we could not upload the file. Please try again.']);
throw new ValidationException($validator);
}
return $filename;
}
}
Oops, something went wrong.

0 comments on commit 37199a0

Please sign in to comment.