thank you !
motchju
@motchju
Posts made by motchju
-
RE: A short question yet, you may know from when AsgardCms also works with PHP7.1
Nicolas updated the CMS yesterday, now compatible with version 5.4 of Laravel
-
RE: How to use cloudfront in asgardcms?
Well with S3, it will work directly, but if on top of S3 you want to use a cloudfront distribution you will have to do it yourself.
the worlflow in Asgard is :
Upload to S3 (if config is properly done)
Then Asgard will know and use the correct url https://s3.eu-central-1.amazonaws.com/xxxxx/photo.jpgThe cloudfront distribution will change the url of https://s3.eu-central-1.amazonaws.com.
So if you don't include your image/video via the Wysiwyg you will be able to link your object easily to the Cloudfront
But like armababy advise, check on Laravel forum's
-
Form request validation
Hi all,
I have a simple form with a validation, for an unknow reason I alway have 500 error when I submit the form with incomplete data. The normal result should be, back to the form and display the errors message
Strange behavior, if APP_DEBUG = true, it is working as expected.
The route:
<?php use Illuminate\Routing\Router; /** @var Router $router */ $router->group(['prefix' =>'/sponsors'], function (Router $router) { $router->bind('sponsors', function ($id) { return app('Modules\Sponsors\Repositories\SponsorsRepository')->find($id); }); $router->get('sponsors', [ 'as' => 'admin.sponsors.sponsors.index', 'uses' => 'SponsorsController3', 'middleware' => 'can:sponsors.sponsors.index' ]); $router->get('sponsors/create', [ 'as' => 'admin.sponsors.sponsors.create', 'uses' => 'SponsorsController@create', 'middleware' => 'can:sponsors.sponsors.create' ]); $router->post('sponsors', [ 'as' => 'admin.sponsors.sponsors.store', 'uses' => 'SponsorsController@store', 'middleware' => 'can:sponsors.sponsors.create' ]); $router->get('sponsors/{sponsors}/edit', [ 'as' => 'admin.sponsors.sponsors.edit', 'uses' => 'SponsorsController@edit', 'middleware' => 'can:sponsors.sponsors.edit' ]); $router->put('sponsors/{sponsors}', [ 'as' => 'admin.sponsors.sponsors.update', 'uses' => 'SponsorsController@update', 'middleware' => 'can:sponsors.sponsors.edit' ]); $router->delete('sponsors/{sponsors}', [ 'as' => 'admin.sponsors.sponsors.destroy', 'uses' => 'SponsorsController@destroy', 'middleware' => 'can:sponsors.sponsors.destroy' ]); // append });
The form request (only one language)
<?php namespace Modules\Sponsors\Http\Requests; use Modules\Core\Internationalisation\BaseFormRequest; class SponsorsStoreRequest extends BaseFormRequest { public function rules() { return [ 'title' => 'required', 'url' => 'sometimes|url', ]; } public function authorize() { return true; } public function messages() { return [ 'title.required' => 'Le titre est obligatoire', 'url.url' => 'Le site n\'est pas valide', ]; } }
The controller:
<?php namespace Modules\Sponsors\Http\Controllers\Admin; use Illuminate\Http\Request; ... use Modules\Sponsors\Events\SponsorsWasCreated; use Modules\Sponsors\Events\SponsorsWasUpdated; use Modules\Sponsors\Http\Requests\SponsorsStoreRequest; class SponsorsController extends AdminBaseController { ... /** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(SponsorsStoreRequest $request) { $data = $request->all(); $sponsors = $this->sponsors->create($data); event(new SponsorsWasCreated($sponsors, $data)); return redirect()->route('admin.sponsors.sponsors.index') ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('sponsors::sponsors.title.sponsors')])); }
-
RE: Assign value when creating item (create view)
Hi,
Did you check the docs and the select macro ?
https://asgardcms.com/docs/v2/core-module/form-macros#translatable-select
Create
{!! Form::i18nSelect('test', ‘test’, $errors, $lang, [1,2,3]) !!}
Edit
{!! Form::i18nSelect(‘test’, ‘test’, $errors, $lang, [1,2,3], $object) !!} // Edit view
And the array [1,2,3] is your value, don't forget to query those value and to pass it to your view
-
RE: Layout usage bewteen backend and frontend
Thanks I will try it asap, in the meantime I mark the question as resolved.
-
Layout usage bewteen backend and frontend
Hi all,
In my current project I do some action from the backend and/or the frontend.
I need to share some layouts, however at this moment, I am stuck because the frontend and the backend don't use the same Theme.
Themes/Adminlte for the admin
Themes/XXXfor the frontendI am sending some email from the backend and the frontend, using the layout "mail.blade.php"
I extends it via @extends('layouts.mail') which is either taking the Adminlte or the XXX theme
The issue is that I have to duplicate this layout because the frontend and the backend are different theme
One solution could be to create a symlink from one theme to the other, however I have to replicate this symlink on every environment.
Is there a way to specify the Theme before I send the email ?
Thank you
-
RE: Media module: Error on insert media
we have discuss via slack, a new version that will fixed this behavior will arrive soon