Giter VIP home page Giter VIP logo

Comments (13)

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 14, 2024

Hello Vista, no doubt there are many issues because I didn't take the time to write any tests ^^
Feel free to propose a PR and i'll check it out ASAP

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

@adr1enbe4udou1n hello bro I am currently deep diving into your code but don't know what these means

'permissions' => session()->get('permissions'),
            'isImpersonation' => session()->has('admin_user_id') && session()->has('temp_user_id'),
            'usurperName' => session()->get('admin_user_name'),

How they get in session cannot find any middle ware and controller which sets these in sessions. Where are they done?

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

@adr1enbe4udou1n And I cannot see any css due to these lines during development so have to comment this in view file?

{{-- @if (app()->environment('production')) --}}

{{-- @endif --}}

how do we run this app properly in development

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 14, 2024

You'll find all this sessions things in app/Repositories/EloquentAccountRepository.php

"permissions" are setted (for caching) in EloquentAccountRepository.php@login method, which is called by app/Listeners/LoginEventListener.php :
session(['permissions' => $user->getPermissions()]);

For impersonation, look at EloquentAccountRepository.php@loginAs


CSS link files are not directly served in development mode because they are already injected into JS files, in order to support HMR (ExtractTextPlugin for webpack is disabled).

In order to see CSS in development, you must compile your dev assets simply by launching yarn watch

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

Thanks got it .
I have trouble understanding this doc.
It says:

So, if a user navigates to http://url-to-laravel/test and the system has this middleware active and 'en' as the current locale for this user, it would redirect (301) him automatically to http://url-to-laravel/en/test. This is mainly used to avoid duplicate content and improve SEO performance.

But in our case we are not redirected right? Why is this happening with our app? Cannot understand how this package work. May be I work only on english :(

And the document also don't mention what these middleware do can you help me because I think you know about it.

'localize' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class,
		'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class,
		'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class,

And document says
If you want to hide the default locale but always show other locales in the url, switch the hideDefaultLocaleInURL config value to true. Once it's true, if the default locale is en (english) all URLs containing /en/ would be redirected to the same url without this fragment '/' but maintaining the locale as en (English).

By hiding do it mean we hide en in url.com/en ? and what that second sentence means ??

And we inject this package class anyreason or to use its helper function.

It will be helpful and after understanding these I can writing test for this app.

Thanks

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

And what should i set in these env files

BROWSERSYNC_PROXY=
BROWSERSYNC_HOST=
BROWSERSYNC_PORT=
WEBPACKDEVSERVER_PORT=

When i run npm run dev it shows

[Browsersync] Access URLs:
 --------------------------------------
          UI: http://localhost:3001
 --------------------------------------
 UI External: http://192.168.0.106:3001
 --------------------------------------

I should enter localhost:3001 in BROWSERSYNC_HOST But what should i enter in other?

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 14, 2024

The simplest URLs config for local dev :

APP_URL=http://localhost:8000 (with php artisan serve)

BROWSERSYNC_PROXY=localhost:8000
BROWSERSYNC_HOST=localhost
BROWSERSYNC_PORT=5000
WEBPACKDEVSERVER_PORT=7000 (for HMR feature)

Then choose between this commands :

  • yarn watch for simpler JS/CSS compiling
  • yarn hot for advanced hot reloading (without browser refresh), very useful for backend development which is full JS

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

Currently I have not set anything and it is working perfectly. Do it mean that defaults works with php artisan serve works fine for default config?

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

Regarding locale can you help me.
I have even created issue on that package. It would be helpful

ARCANEDEV/Localization#107

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 14, 2024

For locale :

  • hideDefaultLocaleInURL is true : if current user locale is same as default APP_LOCALE, /en/about/ is 301 redirected to /about/ (default locale is hidden)
  • hideDefaultLocaleInURL is false : if '/about/' matches to a valide route with current user locale, he will be redirected to /[user_locale]/about/

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

I read docs it says it will redirect url.com/about to url.com/en/about due to SEO. What happen if we turn on hideDefaultLocaleinUrl to true

from laravel-boilerplate.

arcanedev-maroc avatar arcanedev-maroc commented on June 14, 2024

Hi @bloggervista,

The localization package used here is mcamara/laravel-localization and not the ARCANEDEV/Localization.

Check here

from laravel-boilerplate.

shirshak55 avatar shirshak55 commented on June 14, 2024

I guess I should dig in that package.

from laravel-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.