Skip to content

Commit

Permalink
Merge pull request #381 from LavaLite/9.x
Browse files Browse the repository at this point in the history
9.x
  • Loading branch information
georgemjohn authored Mar 6, 2022
2 parents 0f2d7d5 + 88950d8 commit 1353a46
Show file tree
Hide file tree
Showing 151 changed files with 608 additions and 833 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
32 changes: 26 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
APP_NAME=Lavalite
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:dNdNAIP9UhEtvdKOKNY5XYX363GyfLjMctnfU2RkQ90=
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=homestead
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Expand Down
11 changes: 9 additions & 2 deletions .gitattributes
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
33 changes: 13 additions & 20 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
preset: recommended

risky: false

enabled:

disabled:
- align_double_arrow

finder:
exclude:
- "tests"
- "storage"
- "resources"
name:
- "*.php"
not-name:
- "*Stub.php"
depth:
- "< 3"
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
js:
finder:
not-name:
- webpack.mix.js
css: true
9 changes: 0 additions & 9 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
Expand Down
30 changes: 8 additions & 22 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Handler extends ExceptionHandler
/**
* A list of the exception types that are not reported.
*
* @var array
* @var array<int, class-string<Throwable>>
*/
protected $dontReport = [
//
Expand All @@ -19,37 +19,23 @@ class Handler extends ExceptionHandler
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];

/**
* Report or log an exception.
* Register the exception handling callbacks for the application.
*
* @param \Throwable $exception
* @return void
*
* @throws \Exception
*/
public function report(Throwable $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Throwable $exception)
public function register()
{
return parent::render($request, $exception);
$this->reportable(function (Throwable $e) {
//
});
}
}
1 change: 0 additions & 1 deletion app/Forms/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Client extends BaseForm
{

}
1 change: 0 additions & 1 deletion app/Forms/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Master extends BaseForm
{

}
3 changes: 1 addition & 2 deletions app/Forms/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Role extends BaseForm
{

}
}
1 change: 0 additions & 1 deletion app/Forms/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Setting extends BaseForm
{

}
1 change: 0 additions & 1 deletion app/Forms/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class Team extends BaseForm
{

}
4 changes: 1 addition & 3 deletions app/Forms/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

class User extends BaseForm
{


}
}
1 change: 0 additions & 1 deletion app/Http/Controllers/Auth/APILoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller as BaseController;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace App\Http\Controllers\Litepie;
namespace App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use Litepie\Http\Controllers\Controller as BaseController;
use Litepie\Http\Response\ResourceResponse;
use Litepie\Theme\ThemeAndViews;
use Litepie\User\Traits\RoutesAndGuards;
use Litepie\User\Traits\UserPages;
use Form;

class UserProfileController extends BaseController
class ProfileController extends BaseController
{
use RoutesAndGuards, ThemeAndViews, UserPages;

Expand All @@ -22,7 +23,7 @@ public function __construct()
{
$this->setGuard();
$this->response = app(ResourceResponse::class);
$this->middleware("auth:" . guard())->except(['profile']);
$this->middleware("auth:" . guard());
$this->setTheme();
}

Expand All @@ -49,8 +50,18 @@ public function home()
*/
public function profile(Request $request)
{
$user = $request->user();
return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('user::user.name'))
$user = $request->user()->only([
'name',
'email',
'sex',
'mobile',
'languages',
'designation',
'picture',
]);
$user['token'] = $request->header('Authorization');
Form::populate($user);
return $this->response->setMetaTitle(trans('Update') . ' ' . trans('user.user.title.profile'))
->data(compact('user'))
->layout('user')
->view('user.profile')
Expand All @@ -68,7 +79,7 @@ public function profile(Request $request)
public function password(Request $request)
{
$user = $request->user();
return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('user::user.name'))
return $this->response->setMetaTitle(trans('user.user.title.change_password'))
->data(compact('user'))
->layout('user')
->view('user.password')
Expand All @@ -84,8 +95,11 @@ public function password(Request $request)
*/
public function postProfile(Request $request)
{
$data = $request->all();
$user = $request->user();
return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('user::user.name'))
$user->fill($data);
$user->save();
return $this->response->setMetaTitle(trans('user.user.title.profile'))
->data(compact('user'))
->layout('user')
->view('user.profile')
Expand All @@ -103,7 +117,7 @@ public function postProfile(Request $request)
public function postPassword(Request $request)
{
$user = $request->user();
return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('user::user.name'))
return $this->response->setMetaTitle(trans('user.user.title.password'))
->data(compact('user'))
->layout('user')
->view('user.password')
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Litepie/MasterResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function __construct(MasterRepositoryInterface $master)
*/
public function index(MasterRequest $request, $type = null)
{

$pageLimit = $request->input('pageLimit', config('database.pagination.limit'));
$data = $this->repository
->pushFilter(MasterResourceFilter::class)
Expand All @@ -57,7 +56,7 @@ public function index(MasterRequest $request, $type = null)

return $this->response->setMetaTitle(trans('master.master.names'))
->view($view)
->data(compact('data', 'groups', 'modules', 'form', 'count', 'groups'))
->data(compact('data', 'type', 'groups', 'modules', 'form', 'count'))
->output();
}

Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@

class ResourceController extends BaseController
{


}
Loading

0 comments on commit 1353a46

Please sign in to comment.