Skip to content

Commit

Permalink
Merge pull request #387 from viralsolani/develop
Browse files Browse the repository at this point in the history
Merge Develop branch..
  • Loading branch information
viralsolani authored Apr 24, 2019
2 parents 431752c + 322f248 commit 9250b40
Show file tree
Hide file tree
Showing 31 changed files with 2,423 additions and 3,281 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
APP_NAME="Laravel Admin Panel"
APP_SHORT_NAME="LAP"
APP_ENV=local
APP_KEY=base64:O+TrollIDwasHEREtMG9kBc+/Q32exQLusNVhnq558w=
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
Expand All @@ -21,6 +21,7 @@ REQUIRES_APPROVAL=false
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

#Session Timeout
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ public/img/backend/blog_images/*
public/mix-manifest.json
public/access.log
public/error.log
!public/js/jquerysession.min.js
!public/js/jquerysession.min.js
output.txt
.php_cs.cache
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ You can now access the server at http://localhost:8000

- To run test cases, add SQLite support to your php

## Other Important Commands
- To fix php coding standard issues run - composer format
- To perform various self diagnosis tests on your Laravel application. run - php artisan self-diagnosis
- To clear all cache run - composer clear-all
- To built Cache run - composer cache-all
- To clear and built cache run - composer cc

## Logging In

`php artisan db:seed` adds three users with respective roles. The credentials are as follows:
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/V1/BlogTagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function update(Request $request, BlogTag $blog_tag)
$validation = $this->validatingRequest($request, $blog_tag->id);

if ($validation->fails()) {
return $this->throwValidation($validation);
return $this->throwValidation($validation->messages()->first());
}

$this->repository->update($blog_tag, $request->all());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/V1/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'created_at';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'.created_at';

return PagesResource::collection(
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
Expand Down
9 changes: 9 additions & 0 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public function handle($request, Closure $next, $guard = null)
return redirect('/');
}

if ($request->wantsJson() && auth()->guard('api')->user()) {
return response([
'error' => [
'message' => 'Not allowed',
'status_code' => 403,
],
], 403);
}

return $next($request);
}
}
10 changes: 7 additions & 3 deletions app/Models/Access/User/Traits/Attribute/UserAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,13 @@ public function getLoginAsButtonAttribute($class)
if (access()->allow('login-as-user') && (!session()->has('admin_user_id') || !session()->has('temp_user_id'))) {
//Won't break, but don't let them "Login As" themselves
if ($this->id != access()->id()) {
return '<a class="'.$class.'" href="'.route('admin.access.user.login-as',
$this).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.login_as',
['user' => $this->name]).'"></i>'.$name.'</a>';
return '<a class="'.$class.'" href="'.route(
'admin.access.user.login-as',
$this
).'"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="'.trans(
'buttons.backend.access.users.login_as',
['user' => $this->name]
).'"></i>'.$name.'</a>';
}
}

Expand Down
3 changes: 0 additions & 3 deletions app/Models/Faqs/Traits/Attribute/FaqAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ public function getStatusButtonAttribute()
switch ($this->status && access()->allow('edit-faq')) {
case 0:
return '<a href="'.route('admin.faqs.mark', [$this, 1]).'" class="btn btn-flat btn-default"><i class="fa fa-check-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.activate').'"></i></a>';
// No break

case 1:
return '<a href="'.route('admin.faqs.mark', [$this, 0]).'" class="btn btn-flat btn-default"><i class="fa fa-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.deactivate').'"></i></a>';
// No break

default:
return '';
// No break
}

return '';
Expand Down
3 changes: 2 additions & 1 deletion app/Providers/ComposerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public function boot()
*/
View::composer(
// This class binds the $logged_in_user variable to every view
'*', GlobalComposer::class
'*',
GlobalComposer::class
);

/*
Expand Down
3 changes: 3 additions & 0 deletions client/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env"] ]
}
2 changes: 2 additions & 0 deletions client/build/client-modules.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/build/client-modules.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

150 changes: 150 additions & 0 deletions client/build/client-modules.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/build/client-modules.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import samplemodule from './samplemodule/app.js';

window.samplemodule = samplemodule;
9 changes: 9 additions & 0 deletions client/src/samplemodule/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require('./build.css')
class samplemodule
{
constructor()
{
console.log('es6 example');
}
}
export default samplemodule;
Empty file.
65 changes: 65 additions & 0 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* global __dirname, require, module*/

const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
const env = require('yargs').argv.env; // use --env with webpack 2

let libraryName = 'ClientModules';
let outputFileName = 'client-modules';
let outputFile;

let plugins = [
new ExtractTextPlugin({ filename: 'client-modules.min.css', disable: false, allChunks: false})
];

if (env === 'build')
{
outputFile = outputFileName + '.min.js';
}
else
{
outputFile = outputFileName + '.js';
}

const config = {
entry : __dirname + '/src/index.js',
devtool : 'source-map',
output: {
path : __dirname + '/build',
filename : outputFile,
library : libraryName,
libraryTarget : 'umd',
umdNamedDefine : true
},
externals: {
"jquery": "jQuery",
"bootstrap": "bootstrap"
},
module: {
rules: [
{
test : /(\.jsx|\.js)$/,
loader : 'babel-loader',
exclude : /(node_modules|bower_components)/
},
{
test: /\.css$/,
loader: "style-loader!css-loader",
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
// {
// test : /(\.jsx|\.js)$/,
// loader : 'eslint-loader',
// exclude : /node_modules/
// }
]
},
resolve: {
modules: [path.resolve('./src'), '../node_modules'],
extensions: ['.json', '.js', '.css']
},
plugins: plugins
};

module.exports = config;
Loading

0 comments on commit 9250b40

Please sign in to comment.