@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php namespace Distilleries\Expendable\Datatables; |
| 2 | 2 | |
| 3 | -use Distilleries\DatatableBuilder\EloquentDatatable; |
|
| 4 | -use Distilleries\Expendable\Models\Language; |
|
| 3 | +use Distilleries\DatatableBuilder\EloquentDatatable; |
|
| 4 | +use Distilleries\Expendable\Models\Language; |
|
| 5 | 5 | use Distilleries\Expendable\Models\Translation; |
| 6 | 6 | |
| 7 | 7 | abstract class BaseDatatable extends EloquentDatatable {
|
@@ -10,15 +10,15 @@ |
||
| 10 | 10 | // ------------------------------------------------------------------------------------------------ |
| 11 | 11 | public function addTranslationAction($template = 'expendable::admin.form.components.datatable.translations', $route = '') |
| 12 | 12 | {
|
| 13 | - $this->add('translation', function ($model) use ($template, $route) {
|
|
| 13 | + $this->add('translation', function($model) use ($template, $route) {
|
|
| 14 | 14 | |
| 15 | 15 | $languages = Language::withoutCurrentLanguage()->get(); |
| 16 | - $translations = Translation::byElement($model)->pluck('id_element','iso')->toArray();
|
|
| 16 | + $translations = Translation::byElement($model)->pluck('id_element', 'iso')->toArray();
|
|
| 17 | 17 | return view($template, array( |
| 18 | 18 | 'languages' => $languages, |
| 19 | 19 | 'translations' => $translations, |
| 20 | 20 | 'data' => $model->toArray(), |
| 21 | - 'route' => !empty($route) ? $route . '@' : $this->getControllerNameForAction() . '@' |
|
| 21 | + 'route' => !empty($route) ? $route.'@' : $this->getControllerNameForAction().'@' |
|
| 22 | 22 | ))->render(); |
| 23 | 23 | }); |
| 24 | 24 | |
@@ -96,6 +96,10 @@ |
||
| 96 | 96 | ]; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $key |
|
| 101 | + * @param null|integer $default_value |
|
| 102 | + */ |
|
| 99 | 103 | protected function getParams(Request $request, $key, $default_value) |
| 100 | 104 | { |
| 101 | 105 | $element = $request->get($key); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $data = $this->model->where($this->model->getKeyName(), $request->get('id'))->get()->last(); |
| 39 | 39 | $data->delete(); |
| 40 | 40 | |
| 41 | - return redirect()->to(action('\\' . get_class($this) . '@getIndex')); |
|
| 41 | + return redirect()->to(action('\\'.get_class($this).'@getIndex')); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // ------------------------------------------------------------------------------------------------ |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | |
| 6 | 6 | class VerifyCsrfToken extends BaseVerifier { |
| 7 | 7 | |
| 8 | - /** |
|
| 9 | - * Handle an incoming request. |
|
| 10 | - * |
|
| 11 | - * @param \Illuminate\Http\Request $request |
|
| 12 | - * @param \Closure $next |
|
| 13 | - * @return mixed |
|
| 14 | - */ |
|
| 15 | - public function handle($request, Closure $next) |
|
| 16 | - { |
|
| 17 | - return parent::handle($request, $next); |
|
| 18 | - } |
|
| 8 | + /** |
|
| 9 | + * Handle an incoming request. |
|
| 10 | + * |
|
| 11 | + * @param \Illuminate\Http\Request $request |
|
| 12 | + * @param \Closure $next |
|
| 13 | + * @return mixed |
|
| 14 | + */ |
|
| 15 | + public function handle($request, Closure $next) |
|
| 16 | + { |
|
| 17 | + return parent::handle($request, $next); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | public function scopeByElement($query, Model $model) |
| 55 | 55 | { |
| 56 | 56 | return $query->where($this->getTable() . '.' . $this->getModelColumn(), '=', $model->getTable()) |
| 57 | - ->where($this->getTable() . '.' . $this->getIdSourceColumn(), '=', $model->getKey()); |
|
| 57 | + ->where($this->getTable() . '.' . $this->getIdSourceColumn(), '=', $model->getKey()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | } |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | |
| 54 | 54 | public function scopeByElement($query, Model $model) |
| 55 | 55 | { |
| 56 | - return $query->where($this->getTable() . '.' . $this->getModelColumn(), '=', $model->getTable()) |
|
| 57 | - ->where($this->getTable() . '.' . $this->getIdSourceColumn(), '=', $model->getKey()); |
|
| 56 | + return $query->where($this->getTable().'.'.$this->getModelColumn(), '=', $model->getTable()) |
|
| 57 | + ->where($this->getTable().'.'.$this->getIdSourceColumn(), '=', $model->getKey()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Distilleries\Expendable\Contracts\LockableContract; |
| 4 | 4 | use Distilleries\Expendable\Helpers\UserUtils; |
| 5 | -use Distilleries\Expendable\Models\User; |
|
| 6 | 5 | |
| 7 | 6 | class UserListener extends BaseListener |
| 8 | 7 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | |
| 37 | 37 | |
| 38 | - if($model->email != ''){ |
|
| 38 | + if ($model->email != '') { |
|
| 39 | 39 | $model->unlock(); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | - public function postUnLock(Request $request){ |
|
| 56 | + public function postUnLock(Request $request) { |
|
| 57 | 57 | |
| 58 | 58 | $model = $this->model->findOrFail($request->get('id')); |
| 59 | 59 | $model->nb_of_try = 0; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - public function postLock(Request $request){ |
|
| 66 | + public function postLock(Request $request) { |
|
| 67 | 67 | |
| 68 | 68 | $model = $this->model->findOrFail($request->get('id')); |
| 69 | 69 | $model->nb_of_try = config('expendable.auth.nb_of_try'); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Illuminate\Database\Eloquent\Scope; |
| 6 | 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | 7 | |
| 8 | -class StatusScope implements Scope{ |
|
| 8 | +class StatusScope implements Scope { |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * All of the extensions to be added to the builder. |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $this->layoutManager->initStaticPart(function($layoutManager) |
| 50 | 50 | { |
| 51 | 51 | |
| 52 | - $menu_top = $layoutManager->getView()->make('expendable::admin.menu.top',[ |
|
| 52 | + $menu_top = $layoutManager->getView()->make('expendable::admin.menu.top', [ |
|
| 53 | 53 | 'languages'=>Language::all() |
| 54 | 54 | ]); |
| 55 | 55 | $menu_left = $layoutManager->getView()->make('expendable::admin.menu.left'); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: mfrancois |
|
| 5 | - * Date: 6/02/2015 |
|
| 6 | - * Time: 4:37 PM |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: mfrancois |
|
| 5 | + * Date: 6/02/2015 |
|
| 6 | + * Time: 4:37 PM |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Distilleries\Expendable\Exporter; |
| 10 | 10 | |