/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($route)
 {
     if (LaravelLocalization::getCurrentLocale() == 'en') {
         $audience = Audience::where('route_en', $route)->first();
         $audiences = Audience::all();
         return view('audiences.' . $route . '.index')->with(['audience' => $audience, 'audiences' => $audiences]);
     } elseif (LaravelLocalization::getCurrentLocale() == 'nl') {
         $audience = Audience::where('route_nl', $route)->first();
         $audiences = Audience::all();
         return view('audiences.' . $audience->route_en . '.index')->with(['audience' => $audience, 'audiences' => $audiences]);
     }
 }
Exemple #2
0
 /**
  * Handle an incoming request.
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!app()->make('ConferenceBaseController')->getDepartment() && !isAdminPanel()) {
         return redirect('/' . LaravelLocalization::setLocale());
     }
     return $next($request);
 }
 /**
  * @param $view
  *
  * @return mixed
  */
 private function assignDynamicFieldsToPageObject($view)
 {
     $arrAllow = ['page', 'homepage', "en.blog.slug"];
     $data = $view->getData();
     $routName = Route::currentRouteName();
     if (in_array($routName, $arrAllow)) {
         $arrType = config('asgard.dynamicfield.config.entity-type');
         $arrType = array_keys($arrType);
         if (count($data)) {
             foreach ($data as $item) {
                 if (is_object($item)) {
                     $className = get_class($item);
                     if (in_array($className, $arrType)) {
                         $locale = LaravelLocalization::getCurrentLocale();
                         $request = Request::all();
                         $dynamicFields = new DynamicFields($item, $locale);
                         $dynamicFields->init($request);
                         $fieldValues = $dynamicFields->getFieldValues($locale);
                         $view->with('dynamicfields', $fieldValues);
                     }
                 }
             }
         }
     }
     return $view;
 }
Exemple #4
0
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
         $rules['title_' . $short] = 'required|min:1|max:254';
     }
     $rules['sort'] = 'digits_between:1,100000';
     return $rules;
 }
 public function t_fild($ident)
 {
     $lang = LaravelLocalization::setLocale();
     if ($lang) {
         $ident = $ident . "_" . $lang;
     }
     return $ident;
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     /*Localization variable*/
     view()->composer('*', function ($view) {
         $view->with('lang', LaravelLocalization::getCurrentLocale());
     });
     /*Admin main menu list*/
     view()->composer('admin/template/side-bar/menu-left', 'App\\Http\\Composers\\AdminMainMenuListComposer');
 }
 public function subtest()
 {
     $localeCode = LaravelLocalization::getCurrentLocale();
     $urltrans = trans('test::routes.subtest');
     \Debugbar::info($urltrans);
     $test = LaravelLocalization::getLocalizedURL($localeCode, route('test'));
     \Debugbar::info($test);
     return '<p>Sub-test</p><p><b>Language</b>: ' . $localeCode . '</p><p>Our translation url: ' . $urltrans . '</p>';
 }
 /**
  * Extend the validator with new rules.
  * @param  string $rule
  * @return void
  */
 protected function extendValidator($rule)
 {
     $method = studly_case($rule);
     if (\Mcamara\LaravelLocalization\Facades\LaravelLocalization::class) {
         $translation = trans('colorvalidator::validation', [], 'messages', \Mcamara\LaravelLocalization\Facades\LaravelLocalization::getCurrentLocale());
     } else {
         $translation = trans('colorvalidator::validation');
     }
     $this->app['validator']->extend($rule, 'Russoedu\\ColorValidator\\colorvalidator@validate' . $method, $translation[$rule]);
 }
Exemple #9
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($route)
 {
     if (LaravelLocalization::getCurrentLocale() == 'en') {
         $post = Post::where('route_en', $route)->first();
         return view('posts.post')->with(['post' => $post]);
     } elseif (LaravelLocalization::getCurrentLocale() == 'nl') {
         $post = Post::where('route_nl', $route)->first();
         return view('posts.post')->with(['post' => $post]);
     }
 }
Exemple #10
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($route)
 {
     if (LaravelLocalization::getCurrentLocale() == 'en') {
         $page = Page::where(['route_en' => $route])->first();
         return view('pages.index', array('slug' => $page->slug_en, 'page' => $page));
     } elseif (LaravelLocalization::getCurrentLocale() == 'nl') {
         $page = Page::where(['route_nl' => $route])->first();
         return view('pages.index', array('slug' => $page->slug_nl, 'page' => $page));
     }
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $laravelLocale = LaravelLocalization::setLocale() ?: $this->app->config->get('app.fallback_locale');
     $locale = '/' . $laravelLocale;
     $departments = app()->make('ConferenceBaseController')->getDepartments();
     if (count($departments) == 1 && !$request->segment(2)) {
         return redirect($locale . '/' . $departments->first()['keyword']);
     }
     return $next($request);
 }
Exemple #12
0
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $rules = ['active' => 'boolean'];
     foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
         $rules['title_' . $short] = 'required|min:2|max:254';
         //            $rules['description_' . $short] = 'required';
     }
     $rules['sort'] = 'digits_between:1,100000';
     return $rules;
 }
 /**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 public function map(Router $router)
 {
     $router->group(['namespace' => $this->namespace], function (Router $router) {
         $this->loadApiRoutes($router);
     });
     $router->group(['namespace' => $this->namespace, 'prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localizationRedirect']], function (Router $router) {
         $this->loadBackendRoutes($router);
         $this->loadFrontendRoutes($router);
     });
 }
 public function __construct(Request $request)
 {
     $this->local = LaravelLocalization::getCurrentLocale();
     //Current local
     $this->request = $request->url();
     //Current url
     $this->routeName = $request->route()->getAction()['_active_menu'];
     //Current route name
     //dd($this->routeName);
 }
Exemple #15
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getEvent($route)
 {
     if (LaravelLocalization::getCurrentLocale() == 'en') {
         $event = Event::where(['route_en' => $route])->first();
         return view('events.event', array('name' => $event->name_en, 'event' => $event));
     } elseif (LaravelLocalization::getCurrentLocale() == 'nl') {
         $event = Event::where(['route_nl' => $route])->first();
         return view('events.event', array('name' => $event->name_nl, 'event' => $event));
     }
 }
Exemple #16
0
 /**
  * Create an instance of a Date object, when retrieving the updated_at attribute.
  * Set its locale.
  *
  * @param $value
  * @return Date
  */
 protected function getUpdatedAtAttribute($value)
 {
     $date = $this['updated_at'] = Date::parse($value);
     $date->setLocale(LaravelLocalization::getCurrentLocale());
     $locale = LaravelLocalization::getCurrentLocale();
     if ($locale == 'de') {
         return $date->format('j. F, Y');
     } else {
         return $date->format('jS F, Y');
     }
 }
Exemple #17
0
 /**
  * Render an exception into an HTTP response.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Exception  $e
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof ModelNotFoundException) {
         return redirect('/');
     }
     if ($e instanceof MethodNotAllowedHttpException) {
         return redirect('/');
     }
     if ($e instanceof NotFoundHttpException) {
         return response(view('errors.404'), 404);
     }
     if ($e instanceof InvalidConfirmationCodeException) {
         Session::flash('flash_message', $e->getMessage());
         return redirect('/');
     }
     if ($e instanceof UserNotOwnerOfProjectException) {
         Session::flash('flash_message', $e->getMessage());
         return redirect(LaravelLocalization::getCurrentLocale() . '/' . trans('routes.create-project'));
     }
     if ($e instanceof ProjectCompletedException) {
         Session::flash('flash_message', $e->getMessage());
         return redirect(LaravelLocalization::getCurrentLocale() . '/' . trans('routes.create-project'));
     }
     if ($e instanceof UserRequiresAuthenticationException) {
         if ($request->ajax() || $request->wantsJson()) {
             return response()->json(['login' => '<i class="fa fa-exclamation-circle fa-lg"></i>' . trans('create-project-form.login')]);
         } else {
             Session::flash('flash_message', $e->getMessage());
             return redirect('/');
         }
     }
     if ($e instanceof UserHasIncompleteProjectException) {
         if ($request->ajax() || $request->wantsJson()) {
             return response()->json(['incomplete' => '<i class="fa fa-exclamation-circle fa-lg"></i>' . trans('create-project-form.incomplete')]);
         }
     }
     if ($e instanceof UserAlreadyHasSubmittedProjectException) {
         if ($request->ajax() || $request->wantsJson()) {
             return response()->json(['pendingProject' => '<i class="fa fa-exclamation-circle fa-lg"></i>' . trans('create-project-form.pending-project')]);
         }
     }
     if ($e instanceof UserHasCurrentLiveProjectException) {
         if ($request->ajax() || $request->wantsJson()) {
             return response()->json(['liveProject' => '<i class="fa fa-exclamation-circle fa-lg"></i>' . trans('create-project-form.live-project')]);
         }
     }
     if ($e instanceof ProjectNameAlreadyTakenException) {
         if ($request->ajax() || $request->wantsJson()) {
             return response()->json(['duplicateName' => '<i class="fa fa-exclamation-circle fa-lg"></i>' . trans('create-project-form.duplicate-name')]);
         }
     }
     return parent::render($request, $e);
 }
 public function compose(View $view)
 {
     $path = $this->request->path();
     $currentLanguage = LaravelLocalization::getCurrentLocale();
     if (starts_with($path, $currentLanguage . '/')) {
         $path = str_replace($currentLanguage . '/', '', $path);
     } elseif ($path == $currentLanguage) {
         $path = str_replace($currentLanguage, '', $path);
     }
     $main_banners = MainBanner::inURL($path)->orderBy('sort_order', 'ASC')->get();
     $view->with(['main_banners' => $main_banners]);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\Requests\OptionRequest $request
  * @param \App\Criteria $criteria
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\OptionRequest $request, Criteria $criteria)
 {
     DB::transaction(function () use($criteria, $request) {
         $option = $criteria->options()->create(['sort' => $request->get('sort')]);
         $langs = [];
         foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
             $langs[] = ['lang_id' => dbTrans($short), 'title' => $request->get('title_' . $short)];
         }
         $option->langs()->createMany($langs);
     });
     return redirect(action('Admin\\CriteriaOptionController@index', [$criteria->id]))->with('success', 'saved');
 }
Exemple #20
0
 public function getFields()
 {
     $languages = LaravelLocalization::getSupportedLocales();
     foreach ($languages as $locale => $value) {
         $content = $this->getFormContent($locale)->content;
         //FormbuilderShortcode::registerShortcode();
         $shortcodes = Shortcode::all();
         $pattern = $this->getRegex($shortcodes);
         preg_replace_callback("/{$pattern}/s", [&$this, 'getFieldsData'], $content);
     }
     $fields = $this->fieldsDatas;
     return $fields;
 }
Exemple #21
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \App\Http\Requests\NewsRequest $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\NewsRequest $request)
 {
     $departmentId = auth()->user()->department_id;
     if ($request->has('department_id') && $this->systemAdmin) {
         $departmentId = $request->get('department_id');
     }
     DB::transaction(function () use($departmentId, $request) {
         $news = News::create(['department_id' => $departmentId, 'active' => $request->get('active'), 'sort' => $request->get('sort')]);
         $langs = [];
         foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
             $langs[] = ['lang_id' => dbTrans($short), 'title' => $request->get('title_' . $short), 'description' => $request->get('description_' . $short)];
         }
         $news->langs()->createMany($langs);
     });
     return redirect(action('Admin\\NewsController@index'))->with('success', 'saved');
 }
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $imageMax = 1024;
     $rules = ['keyword' => [1 => 'required', 2 => 'max:6', 3 => 'unique:department,keyword', 4 => 'regex:' . config('app.expressions.dir')], 'image' => 'required|image|max:' . $imageMax, 'theme_background_color' => 'required', 'theme_color' => 'required', 'sort' => 'digits_between:1,100000'];
     foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
         $rules['name_' . $short] = 'required|min:2|max:100';
         $rules['title_' . $short] = 'required|min:2|max:254';
         $rules['description_' . $short] = 'required|min:2|max:100';
     }
     $id = $this->request->get('id');
     if ($id) {
         #update request
         $rules['keyword'][3] .= ',' . $id;
         if (!$this->request->get('image')) {
             $rules['image'] = '';
         }
     }
     return $rules;
 }
 /**
  * Set entity data.
  *
  * @param null $default
  */
 public function init($default = null)
 {
     $this->request = $default;
     $locale = $this->locale;
     $entityItem = $this->entity;
     $type = $this->type;
     if (isset($locale)) {
         $entity = new Entity($entityItem->id, $entityItem->template, $locale, $type);
         $entity->init($default);
         $this->entities[$locale] = $entity;
     } else {
         $languages = LaravelLocalization::getSupportedLocales();
         foreach ($languages as $locale => $code) {
             $entity = new Entity(@$entityItem->id, @$entityItem->template, $locale, $type);
             $entity->init($default);
             $this->entities[$locale] = $entity;
         }
     }
 }
 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     $this->auth->logout();
     // store success feed back message in a session
     if (Session::has('deleted')) {
         Session::flash('flash_message', Session::get('deleted'));
         Session::forget('deleted');
     } else {
         Session::flash('flash_message', trans('login-page.logout'));
     }
     // clear user_id key in session
     Session::forget('username');
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : LaravelLocalization::getCurrentLocale() . '/' . trans('routes.account/login'));
 }
 public function getCreate()
 {
     // Title
     $title = 'Boite de réception';
     JavaScript::put(['locale' => LaravelLocalization::setLocale()]);
     $data = array('action' => 'add', 'title' => $title, 'uriModule' => route('create_contacts'), 'contact' => array());
     // Show the page
     return View::make('admin.create', $data);
 }
Exemple #26
0
    /*-- Password reset Page --*/
    Route::get(LaravelLocalization::transRoute('routes.account/reset'), 'Auth\\PasswordController@getEmail');
    Route::post(LaravelLocalization::transRoute('routes.password/email'), 'Auth\\PasswordController@postEmail');
    Route::get(LaravelLocalization::transRoute('routes.password/reset') . '/{token}', 'Auth\\PasswordController@getReset');
    Route::post(LaravelLocalization::transRoute('routes.password/reset') . '/{token}', 'Auth\\PasswordController@postReset');
    /*-- Userpanel, Pages --*/
    Route::get(LaravelLocalization::transRoute('routes.account') . '/{username}', 'UserpanelController@show');
    Route::post(LaravelLocalization::transRoute('routes.account') . '/{username}', 'UserpanelController@update');
    Route::get(LaravelLocalization::transRoute('routes.account/delete') . '/{username}', 'UserpanelController@delete');
    Route::get(LaravelLocalization::transRoute('routes.favourite/add') . '/{id}', 'UserpanelController@addFavourite');
    Route::get(LaravelLocalization::transRoute('routes.favourite/remove') . '/{id}', 'UserpanelController@removeFavourite');
    Route::get(LaravelLocalization::transRoute('routes.toggle') . '/{id}', 'UserpanelController@edit');
    /*-- Adminpanel Page --*/
    Route::get(LaravelLocalization::transRoute('routes.admin'), 'AdminController@index');
    Route::get(LaravelLocalization::transRoute('routes.admin/edit-project') . '/{slug}', 'AdminController@getEditProject');
    Route::patch(LaravelLocalization::transRoute('routes.admin/edit-project') . '/{slug}', 'AdminController@patchEditProject');
    Route::get(LaravelLocalization::transRoute('routes.admin/approve-project') . '/{slug}', 'AdminController@getApproveProject');
    Route::get(LaravelLocalization::transRoute('routes.sponsor/remove') . '/{id}', 'AdminController@removeSponsor');
    Route::get(LaravelLocalization::transRoute('routes.sponsor/relist') . '/{id}', 'AdminController@relistSponsor');
    Route::post(LaravelLocalization::transRoute('routes.sponsor/add'), 'AdminController@addSponsor');
    /*-- Newsletter sign up --*/
    Route::post(LaravelLocalization::transRoute('routes.newsletter'), 'ContactFormController@postNewsletter');
    /*-- Payment --*/
    Route::controller('paytest', 'PaymentController');
    /*-- Share Project via Email --*/
    Route::post(LaravelLocalization::transRoute('routes.share-project'), 'ProjectsController@shareProject');
    /** ADD ADDITIONAL ROUTES INSIDE HERE (INSIDE OF THIS GROUP) **/
    //Route::get(LaravelLocalization::transRoute('routes.<key>'), '<Controller>@<Method>');
});
/** OTHER PAGES THAT SHOULD NOT BE LOCALIZED for example just German pages**/
// Route::get('test', '<Controller>@<Method>');
<?php

use Illuminate\Support\Facades\Route;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize']], function () {
    Route::get('/', function () {
        return redirect()->route('welcome');
    });
    Route::get('welcome', ['as' => 'welcome', 'uses' => 'HomeController@index']);
    //Help routes
    Route::get('faq', ['as' => 'faq', 'uses' => 'HelpController@faq']);
    Route::post('searchfaq', ['as' => 'searchfaq', 'uses' => 'HelpController@searchfaq']);
    Route::get('contact/{auction_id}', ['as' => 'contact', 'uses' => 'HelpController@contact']);
    Route::post('confirmquestion', ['as' => 'confirmquestion', 'uses' => 'HelpController@confirmquestion']);
    Route::post('confirmquestion_send', ['as' => 'confirmquestion_send', 'uses' => 'HelpController@confirmquestion_send']);
    Route::post('search', ['as' => 'search', 'uses' => 'HelpController@search']);
    //Art routes
    Route::get('arts', ['as' => 'arts', 'uses' => 'ArtController@overzicht']);
    Route::get('detail/{art_id}', ['as' => 'art_detail', 'uses' => 'ArtController@detail']);
    Route::get('sortOverzicht/{by}/{direction}', ['as' => 'sort_overzicht', 'uses' => 'ArtController@sortOverzicht']);
    Route::get('filter_overzicht/{by}/{bottom}/{top}', ['as' => 'filter_overzicht', 'uses' => 'ArtController@filterOverzicht']);
    Route::get('clear', ['as' => 'clear', 'uses' => 'ArtController@clearFilter']);
    //Auction routes
    Route::get('myauctions', ['as' => 'myauctions', 'uses' => 'AuctionController@myauctions']);
    Route::get('mywatchlist', ['as' => 'mywatchlist', 'uses' => 'AuctionController@mywatchlist']);
    Route::get('addwatchlist/{art_id}', ['as' => 'addwatchlist', 'uses' => 'AuctionController@storewatchlist']);
    Route::get('clearwatchlist/', ['as' => 'clearwatchlist', 'uses' => 'AuctionController@clearwatchlist']);
    Route::post('deletewatchlist/', ['as' => 'deletewatchlist', 'uses' => 'AuctionController@deletewatchlist']);
    Route::get('mybids', ['as' => 'mybids', 'uses' => 'AuctionController@mybids']);
    Route::post('addbid/{art_id}', ['as' => 'addbid', 'uses' => 'AuctionController@storebid']);
    Route::get('buy/{art_id}', ['as' => 'buy', 'uses' => 'AuctionController@buy']);
 private function addDepartmentLangs(Requests\DepartmentRequest $request, Department $department)
 {
     $langs = [];
     foreach (LaravelLocalization::getSupportedLocales() as $short => $locale) {
         $langs[] = ['lang_id' => dbTrans($short), 'name' => $request->get('name_' . $short), 'title' => $request->get('title_' . $short), 'description' => $request->get('description_' . $short)];
     }
     $department->langs()->createMany($langs);
 }
 /**
  * Save an incomplete state of a Project.
  *
  * @param SaveProjectRequest $request
  * @return string
  * @throws ProjectNameAlreadyTakenException
  */
 public function save(SaveProjectRequest $request)
 {
     $existingProject = Project::where('project_name', '=', $request->get('project_name'))->first();
     if (!is_null($existingProject) && $existingProject->user_id != Auth::user()->id) {
         throw new ProjectNameAlreadyTakenException();
     }
     $projectDetails = ['project_name' => $request->get('project_name'), 'short_desc' => $request->get('short_desc'), 'full_desc' => $request->get('full_desc'), 'target_amount' => $request->get('target_amount'), 'child_name' => $request->get('child_name'), 'slug' => strtolower(preg_replace('/[\\s-]+/', '-', $request->get('project_name'))), 'user_id' => Auth::user()->id];
     $userDetails = ['first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'email' => $request->get('email'), 'tel_number' => $request->get('tel_number'), 'street' => $request->get('street'), 'postcode' => $request->get('postcode'), 'city' => $request->get('city'), 'country' => $request->get('country')];
     $userDocuments = [$request->file('doc_1_mand') ? $request->file('doc_1_mand') : $request->get('doc1Mand'), $request->file('doc_2_mand') ? $request->file('doc_2_mand') : $request->get('doc2Mand'), $request->file('doc_3') ? $request->file('doc_3') : $request->get('doc3'), $request->file('doc_4') ? $request->file('doc_4') : $request->get('doc4'), $request->file('doc_5') ? $request->file('doc_5') : $request->get('doc5'), $request->file('doc_6') ? $request->file('doc_6') : $request->get('doc6')];
     $userImages = ['main_img' => $request->file('main_img') ? $request->file('main_img') : $request->get('mainImage'), 'img_2' => $request->file('img_2') ? $request->file('img_2') : $request->get('img2'), 'img_3' => $request->file('img_3') ? $request->file('img_3') : $request->get('img3'), 'img_4' => $request->file('img_4') ? $request->file('img_4') : $request->get('img4')];
     // Find the Project which belongs to the user, or create a new one.
     $projectID = !is_null(Auth::user()->incompleteProject->first()) ? Auth::user()->incompleteProject->first()->id : null;
     $project = Project::findOrNew($projectID);
     // Store the original project slug,
     // for the saved images, in case of user edit.
     $originalProjectSlug = $project->slug;
     // Update or fill the Project attributes.
     foreach ($projectDetails as $attribute => $value) {
         $project->{$attribute} = $value;
     }
     // Save the changes to the Project.
     $project->save();
     // Update user model.
     $user = Auth::user();
     foreach ($userDetails as $attribute => $value) {
         $user->{$attribute} = $value;
     }
     $user->save();
     // Make the image and document directories.
     $imageFolderPath = public_path("img/{$project->slug}");
     $documentFolderPath = public_path("documents/{$project->slug}");
     $this->makeImageDirectories($imageFolderPath);
     $this->makeDocumentDirectory($documentFolderPath);
     // Create new Document instances in the database.
     // Move the documents to their directory.
     $this->moveDocumentsAndSaveToDB($userDocuments, $documentFolderPath, $project->id, $originalProjectSlug);
     // Resize the images to our needs, and save them in their directories.
     $this->resizeImagesAndSaveToFolders($userImages, $project->child_name, $imageFolderPath, $originalProjectSlug);
     // Create new Image instances in the database.
     $this->saveImageInstancesToDB($userImages, $project->child_name, $project->id);
     Session::flash('flash_message', trans('create-project-form.save-success'));
     return json_encode(['url' => url(LaravelLocalization::getCurrentLocale() . '/' . trans('routes.create-project/edit') . '/' . $project->slug)]);
 }
Exemple #30
0
 public function getLanguage()
 {
     return LaravelLocalization::setLocale() ?: 'en';
 }