@@ -26,17 +26,17 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * @var DatastoreRepository |
28 | 28 | */ |
29 | - protected $datastoreRepository; |
|
29 | + protected $datastoreRepository; |
|
30 | 30 | |
31 | - /** |
|
32 | - * UserController constructor. |
|
33 | - * |
|
34 | - * @param DatastoreRepository $datastoreRepository |
|
35 | - */ |
|
36 | - public function __construct(DatastoreRepository $datastoreRepository) |
|
37 | - { |
|
38 | - $this->datastoreRepository = $datastoreRepository; |
|
39 | - } |
|
31 | + /** |
|
32 | + * UserController constructor. |
|
33 | + * |
|
34 | + * @param DatastoreRepository $datastoreRepository |
|
35 | + */ |
|
36 | + public function __construct(DatastoreRepository $datastoreRepository) |
|
37 | + { |
|
38 | + $this->datastoreRepository = $datastoreRepository; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | |
42 | 42 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | public function file(Request $request) { |
332 | 332 | $this->validate($request, [ |
333 | - 'file' => 'required' |
|
333 | + 'file' => 'required' |
|
334 | 334 | ]); |
335 | 335 | |
336 | 336 | $originalFile= $request->file('file'); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | public function image(Request $request) { |
349 | 349 | $this->validate($request, [ |
350 | - 'file' => 'image|required|mimes:jpeg,png,jpg,gif,svg' |
|
350 | + 'file' => 'image|required|mimes:jpeg,png,jpg,gif,svg' |
|
351 | 351 | ]); |
352 | 352 | |
353 | 353 | $originalImage= $request->file('file'); |
@@ -403,35 +403,35 @@ discard block |
||
403 | 403 | $term = $request->input('term'); |
404 | 404 | $q = $request->input('q'); |
405 | 405 | |
406 | - if ($term) { |
|
407 | - $vars = array(); |
|
408 | - $type = null; |
|
406 | + if ($term) { |
|
407 | + $vars = array(); |
|
408 | + $type = null; |
|
409 | 409 | |
410 | - //determine what to look for |
|
411 | - switch ($q) { |
|
412 | - case "checkbox": |
|
413 | - $type = \Phpsa\CamsGallery\Ams\Gallery\ImageAsset::class; |
|
414 | - break; |
|
410 | + //determine what to look for |
|
411 | + switch ($q) { |
|
412 | + case "checkbox": |
|
413 | + $type = \Phpsa\CamsGallery\Ams\Gallery\ImageAsset::class; |
|
414 | + break; |
|
415 | 415 | |
416 | - case "radio": |
|
417 | - $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
418 | - break; |
|
416 | + case "radio": |
|
417 | + $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
418 | + break; |
|
419 | 419 | |
420 | - case "textfield": |
|
421 | - $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
422 | - break; |
|
420 | + case "textfield": |
|
421 | + $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
422 | + break; |
|
423 | 423 | |
424 | - case "textarea": |
|
425 | - $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
426 | - break; |
|
424 | + case "textarea": |
|
425 | + $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
426 | + break; |
|
427 | 427 | |
428 | - case "fieldset": |
|
429 | - $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
430 | - break; |
|
428 | + case "fieldset": |
|
429 | + $type = Phpsa\Datastore\Ams\BooleanAsset::class; |
|
430 | + break; |
|
431 | 431 | |
432 | - default: |
|
433 | - return false; |
|
434 | - } |
|
432 | + default: |
|
433 | + return false; |
|
434 | + } |
|
435 | 435 | |
436 | 436 | |
437 | 437 | $query = DatastoreModel::where('value','like','%' . $term . '%') |
@@ -454,8 +454,8 @@ discard block |
||
454 | 454 | $data = db::getAll($sql, $vars); |
455 | 455 | echo json_encode($data); |
456 | 456 | exit;*/ |
457 | - } |
|
458 | - return response()->json( []); |
|
459 | - } |
|
457 | + } |
|
458 | + return response()->json( []); |
|
459 | + } |
|
460 | 460 | |
461 | 461 | } |
@@ -9,22 +9,22 @@ |
||
9 | 9 | |
10 | 10 | class CommentsController extends Controller |
11 | 11 | { |
12 | - /** |
|
13 | - * Store a newly created resource in storage. |
|
14 | - * |
|
15 | - * @param \Illuminate\Http\Request $request |
|
16 | - * @return \Illuminate\Http\Response |
|
17 | - */ |
|
18 | - public function store(Request $request) |
|
19 | - { |
|
20 | - $request->validate([ |
|
12 | + /** |
|
13 | + * Store a newly created resource in storage. |
|
14 | + * |
|
15 | + * @param \Illuminate\Http\Request $request |
|
16 | + * @return \Illuminate\Http\Response |
|
17 | + */ |
|
18 | + public function store(Request $request) |
|
19 | + { |
|
20 | + $request->validate([ |
|
21 | 21 | 'body'=>'required', |
22 | 22 | 'datastore_id' => 'required' |
23 | - ]); |
|
24 | - $input = $request->all(); |
|
25 | - $input['user_id'] = auth()->user()->id; |
|
26 | - DatastoreComments::create($input); |
|
27 | - return back(); |
|
28 | - } |
|
23 | + ]); |
|
24 | + $input = $request->all(); |
|
25 | + $input['user_id'] = auth()->user()->id; |
|
26 | + DatastoreComments::create($input); |
|
27 | + return back(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | Breadcrumbs::for('admin.ams.content.list', function ($trail, $asset) { |
4 | - $trail->parent('admin.dashboard'); |
|
4 | + $trail->parent('admin.dashboard'); |
|
5 | 5 | $trail->push(__('phpsa-datastore::backend.menus.sidebar.main'), route('admin.ams.content.list', $asset)); |
6 | 6 | }); |
7 | 7 | |
8 | 8 | Breadcrumbs::for('admin.ams.content.create', function ($trail, $asset) { |
9 | - $trail->parent('admin.dashboard'); |
|
9 | + $trail->parent('admin.dashboard'); |
|
10 | 10 | $trail->push(__('phpsa-datastore::backend.menus.sidebar.main'), route('admin.ams.content.list', $asset)); |
11 | 11 | $trail->push(__('phpsa-datastore::backend.menus.sidebar.create')); |
12 | 12 | }); |
13 | 13 | |
14 | 14 | Breadcrumbs::for('admin.ams.content.update', function ($trail, $asset) { |
15 | - $trail->parent('admin.dashboard'); |
|
15 | + $trail->parent('admin.dashboard'); |
|
16 | 16 | $trail->push(__('phpsa-datastore::backend.menus.sidebar.main'), route('admin.ams.content.list', $asset)); |
17 | 17 | $trail->push(__('phpsa-datastore::backend.menus.sidebar.update')); |
18 | 18 | }); |
19 | 19 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | class Datastore extends Facade |
8 | 8 | { |
9 | - protected static function getFacadeAccessor() |
|
10 | - { |
|
11 | - return 'datastore'; |
|
12 | - } |
|
9 | + protected static function getFacadeAccessor() |
|
10 | + { |
|
11 | + return 'datastore'; |
|
12 | + } |
|
13 | 13 | } |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | |
10 | 10 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
11 | 11 | { |
12 | - const CONFIG_PATH = __DIR__ . '/../config/datastore.php'; |
|
12 | + const CONFIG_PATH = __DIR__ . '/../config/datastore.php'; |
|
13 | 13 | |
14 | - public function boot() |
|
15 | - { |
|
14 | + public function boot() |
|
15 | + { |
|
16 | 16 | // publish our pacakge |
17 | - $this->publishes([ |
|
18 | - self::CONFIG_PATH => config_path('datastore.php'), |
|
17 | + $this->publishes([ |
|
18 | + self::CONFIG_PATH => config_path('datastore.php'), |
|
19 | 19 | ], 'config'); |
20 | 20 | |
21 | 21 | //set our migratinos directory |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | ]); |
44 | 44 | |
45 | 45 | $this->registerBladeHelpers(); |
46 | - } |
|
46 | + } |
|
47 | 47 | |
48 | - public function register() |
|
49 | - { |
|
50 | - $this->mergeConfigFrom( |
|
51 | - self::CONFIG_PATH, |
|
52 | - 'datastore' |
|
53 | - ); |
|
48 | + public function register() |
|
49 | + { |
|
50 | + $this->mergeConfigFrom( |
|
51 | + self::CONFIG_PATH, |
|
52 | + 'datastore' |
|
53 | + ); |
|
54 | 54 | |
55 | - $this->app->bind('datastore', function () { |
|
56 | - return new Datastore(); |
|
55 | + $this->app->bind('datastore', function () { |
|
56 | + return new Datastore(); |
|
57 | 57 | }); |
58 | 58 | |
59 | 59 | $this->loadViewsFrom(__DIR__.'/views', 'phpsa-datastore'); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | public function registerBladeHelpers(){ |
64 | 64 | Blade::directive('datastoreAssetList', function ($grouped = false) { |
65 | - return Helpers::getAssetList($grouped, false); |
|
65 | + return Helpers::getAssetList($grouped, false); |
|
66 | 66 | }); |
67 | 67 | |
68 | 68 | Blade::directive('forDatastores', function () { |
@@ -19,8 +19,8 @@ |
||
19 | 19 | |
20 | 20 | |
21 | 21 | public function parent() |
22 | - { |
|
23 | - return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
22 | + { |
|
23 | + return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function page() |
@@ -11,37 +11,37 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | /** |
14 | - * @return string |
|
15 | - */ |
|
16 | - public function getEditButtonAttribute() |
|
17 | - { |
|
18 | - return '<a href="'.route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]).'" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.edit').'" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
14 | + * @return string |
|
15 | + */ |
|
16 | + public function getEditButtonAttribute() |
|
17 | + { |
|
18 | + return '<a href="'.route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]).'" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.edit').'" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
22 | - * @return string |
|
23 | - */ |
|
24 | - public function getDeleteButtonAttribute() |
|
25 | - { |
|
22 | + * @return string |
|
23 | + */ |
|
24 | + public function getDeleteButtonAttribute() |
|
25 | + { |
|
26 | 26 | |
27 | - return '<a href="'.route('admin.ams.content.destroy', $this).'" |
|
27 | + return '<a href="'.route('admin.ams.content.destroy', $this).'" |
|
28 | 28 | data-method="delete" |
29 | 29 | data-trans-button-cancel="'.__('buttons.general.cancel').'" |
30 | 30 | data-trans-button-confirm="'.__('buttons.general.crud.delete').'" |
31 | 31 | data-trans-title="'.__('strings.backend.general.are_you_sure').'" |
32 | 32 | class="btn btn-danger"><i class="fas fa-trash" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.delete').'"></i></a> '; |
33 | 33 | |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function getActionButtonsAttribute() |
|
40 | - { |
|
36 | + /** |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function getActionButtonsAttribute() |
|
40 | + { |
|
41 | 41 | |
42 | 42 | if($this->id) |
43 | 43 | { |
44 | - return '<div class="btn-group" role="group" aria-label="'.__('labels.backend.access.users.user_actions').'"> |
|
44 | + return '<div class="btn-group" role="group" aria-label="'.__('labels.backend.access.users.user_actions').'"> |
|
45 | 45 | '.$this->edit_button.' |
46 | 46 | '.$this->delete_button.' |
47 | 47 | </div>'; |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | protected $table = 'datastore'; |
18 | 18 | |
19 | 19 | /** |
20 | - * @var array |
|
21 | - */ |
|
22 | - protected $dates = [ |
|
23 | - 'start_date', |
|
20 | + * @var array |
|
21 | + */ |
|
22 | + protected $dates = [ |
|
23 | + 'start_date', |
|
24 | 24 | 'end_date', |
25 | 25 | 'updated_at', |
26 | 26 | 'created_at' |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | public function properties() |
31 | - { |
|
32 | - return $this->hasMany(Datastore::class); |
|
33 | - } |
|
31 | + { |
|
32 | + return $this->hasMany(Datastore::class); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | public function assets() |
36 | 36 | { |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | |
54 | 54 | |
55 | 55 | /** |
56 | - * The has Many Relationship |
|
57 | - * |
|
58 | - * @var array |
|
59 | - */ |
|
60 | - public function comments() |
|
61 | - { |
|
62 | - return $this->hasMany(DatastoreComments::class)->whereNull('parent_id'); |
|
63 | - } |
|
56 | + * The has Many Relationship |
|
57 | + * |
|
58 | + * @var array |
|
59 | + */ |
|
60 | + public function comments() |
|
61 | + { |
|
62 | + return $this->hasMany(DatastoreComments::class)->whereNull('parent_id'); |
|
63 | + } |
|
64 | 64 | |
65 | 65 | |
66 | 66 |
@@ -9,35 +9,35 @@ |
||
9 | 9 | class DatastoreComments extends Model |
10 | 10 | { |
11 | 11 | |
12 | - use SoftDeletes; |
|
13 | - |
|
14 | - protected $dates = ['deleted_at']; |
|
15 | - |
|
16 | - /** |
|
17 | - * The attributes that are mass assignable. |
|
18 | - * |
|
19 | - * @var array |
|
20 | - */ |
|
21 | - protected $fillable = ['user_id', 'datastore_id', 'parent_id', 'body']; |
|
22 | - |
|
23 | - /** |
|
24 | - * The belongs to Relationship |
|
25 | - * |
|
26 | - * @var array |
|
27 | - */ |
|
28 | - public function user() |
|
29 | - { |
|
30 | - return $this->belongsTo(User::class); |
|
31 | - } |
|
32 | - |
|
33 | - /** |
|
34 | - * The has Many Relationship |
|
35 | - * |
|
36 | - * @var array |
|
37 | - */ |
|
38 | - public function replies() |
|
39 | - { |
|
40 | - return $this->hasMany(DatastoreComments::class, 'parent_id'); |
|
41 | - } |
|
12 | + use SoftDeletes; |
|
13 | + |
|
14 | + protected $dates = ['deleted_at']; |
|
15 | + |
|
16 | + /** |
|
17 | + * The attributes that are mass assignable. |
|
18 | + * |
|
19 | + * @var array |
|
20 | + */ |
|
21 | + protected $fillable = ['user_id', 'datastore_id', 'parent_id', 'body']; |
|
22 | + |
|
23 | + /** |
|
24 | + * The belongs to Relationship |
|
25 | + * |
|
26 | + * @var array |
|
27 | + */ |
|
28 | + public function user() |
|
29 | + { |
|
30 | + return $this->belongsTo(User::class); |
|
31 | + } |
|
32 | + |
|
33 | + /** |
|
34 | + * The has Many Relationship |
|
35 | + * |
|
36 | + * @var array |
|
37 | + */ |
|
38 | + public function replies() |
|
39 | + { |
|
40 | + return $this->hasMany(DatastoreComments::class, 'parent_id'); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | \ No newline at end of file |