Andreas94

Andreas94

Member Since 2 Years Ago

Experience Points 2,950
Experience Level 1

2,050 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

14 Sep
2 days ago

Andreas94 started a new conversation Why /forum Do I Redirect To Public/forum?

I'm having a mystery about my Laravel. I installed the forum in public/forum and it works.

If I go to domain.com/forum I have a redirect to public/forum, but if I go to the forum/index.php it works. it's not even an Htaccess problem, because if I go to: forum/admin it works!

Do you have any ideas?

/public/forum/.htaccess:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /forum/404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>

public/.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ / [L,R=301]

    RewriteCond %{HTTP_HOST} ^www\.domain\.net [NC]
    RewriteRule ^(.*)$ https://domain.net/ [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


</IfModule>

/httpdocs/.htaccess (root Laravel)

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/ [L]
</IfModule>

but other pages like: forum/topic/1-welcome/ they work very well.

Andreas94 left a reply on Htaccess In Conflict

surely I would like to solve this problem in the router, but anyway I have verified and it seems that the problem is not him...

12 Sep
4 days ago

Andreas94 left a reply on Htaccess In Conflict

The forum htaccess can be found in / public / forum, but as soon as I activate it, when I visit a forum page it returns an error 404.

will it be my fault with this router instruction?

Route::get('{platform}', '[email protected]');

if so, how can I limit this statement only to the words: ps4|xone|pc|switch?

with the htaccess I would have done:

RewriteRule ^(ps4|xone|pc|switch)/$ index.php?p=console&nome_console= [QSA,L]

but with laravel?

Andreas94 left a reply on Htaccess In Conflict

has anyone ever installed a forum in laravel?

11 Sep
5 days ago

Andreas94 started a new conversation Htaccess In Conflict

Hi guys, I'm installing an IP.Board forum in Laravel in the public folder, but as active the mod_rewrite putting the forum htaccess, the forum is no longer accessible. I tried with Xenforo and also with him I have this error.

The forum no longer works as soon as I enable friendly url with htaccess. How can I make use of the forum's htaccess only in the / public/forum folder?

20 Aug
3 weeks ago

Andreas94 left a reply on Crawler From URL With Symfony\DomCrawler

do you know something similar for laravel? https://github.com/scrapinghub/extruct.

unfortunately there is no way with the symfony crawler

19 Aug
4 weeks ago

Andreas94 left a reply on Crawler From URL With Symfony\DomCrawler

The site has just moved the JSON and now it is:

<script id="server-app-state" type="application/json">{"slug":"red-dead-redemption-2"

for the occasion I have tried with

      $html = file_get_contents('https://next.igdb.com/games/red-dead-redemption-2');
      $crawler = new Crawler($html);
      $data = $crawler->filterXpath('//script[@type="application/ld+json"]');
      dd ($data);

but when I go to see the debug I notice that I extract the whole html page: https://pasteboard.co/IttgEba.png

why is my fileterxpath request completely ignored?

I also tried the json id, the one that gives me the chrome console if I ask to copy the xpath of the element:

      $data = $crawler->filterXpath('//*[@id="server-app-state"]');

the result is always the same.

17 Aug
4 weeks ago

Andreas94 started a new conversation Crawler From URL With Symfony\DomCrawler

Hi, I need to extract the JSON contained in data-react-props:

use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\CssSelector\CssSelectorConverter;

$html = file_get_html('https://www.igdb.com/games/simcity--2');
$crawler = new Crawler($html);
$data = $crawler->filter('div[data-react-class="GamePageHeader"]')->attr('data-react-props');

print $data;

But I always get the error

LOG.error: Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "simple_html_dom".

Andreas94 left a reply on Save Image From Remote URL

Thanks @snapey for the supporto. Now i have this error:

$cover = file_get_contents('https:' . $game->cover->url);
$filename = rand().'-.'.str_slug($game->name, '-');
Image::make($cover)->save(public_path('/upload/cover/' . $filename));
$platform->immagine = '/upload/cover/' . $filename;

LOG.info: Encoding format (simcity) is not supported.

simcity is $game->name

I think I went into confusion...

Edit

I solved with:

Image::make($cover)->save(public_path('/upload/cover/' . $filename . '.jpg'));

Is it possible to take the original extension? getClientOriginalExtension()it does not work

16 Aug
1 month ago

Andreas94 left a reply on Save Image From Remote URL

Again error LOG.info: [INVALID UTF-8 DATA] with:

$cover = file_get_contents('https:'. $game->cover->url);

Andreas94 started a new conversation Save Image From Remote URL

Hi guys

I'm trying to extract an image from an API.

With the variable $game->cover->url I get //images.igdb.com/igdb/image/upload/t_thumb/csbqnva4b4nzdjgkbe8c.jpg, I would like this image in /upload /cover but every tenativo I do I fail him.

This is my code:

$cover = file_get_contents($game->cover->url);
$filename = rand().'-.'.$cover;
Image::make($cover)->save(public_path('/upload/cover' . $filename));
$platform->immagine = '/upload/cover/' . $name_cover;
dd($platform);

But I get the error LOG.info: [INVALID UTF-8 DATA]

I also tried with:

$cover = file_get_contents($game->cover->url);
$name_cover = substr($cover, strrpos($cover, '/upload/cover/') + 1);
Storage::put($name_cover, $cover);
$platform->immagine = '/upload/cover/' . $name_cover;
dd($platform);

But with this new code I get the error: LOG.info: file_get_contents(//images.igdb.com/igdb/image/upload/t_thumb/csbqnva4b4nzdjgkbe8c.jpg): failed to open stream: No such file or directory

How do I save the image of the URL in my server?

15 Aug
1 month ago

Andreas94 left a reply on Url Not Existing Leads To Error 500 Because I Use Too Large A Slug

The second opinion seems to me better, I added the resolveRouteBinding to the Platform model, But what should I indicate in the router?

I have to work in the file RouteServiceProvider?

Andreas94 started a new conversation Url Not Existing Leads To Error 500 Because I Use Too Large A Slug

Hi everyone, I need advice:

i have: domain.ext/slug which refers to a DB if there is an example:

ID slug 1 ps4 2 xone 4 pc

Depending on the slug he loads the articles of the platform, but if one accidentally goes to a page that does not exist.

Example: doamin.ext/press it does not receive error 404 but error 500 because it cannot find the value in the table.

How do I in the route indicate the "available" names for the url?

at the moment it is:

Route::get('{platform}', '[email protected]');

Something to limit the available platforms like:

Route::get('{ps4|xone|pc}', '[email protected]');

is such a thing possible?

09 Aug
1 month ago

Andreas94 left a reply on Syntax Error, Unexpected '(', Expecting Identifier (T_STRING) Or Variable (T_VARIABLE) Or '{' Or '$'

I swear my eye didn't fall for me... Time wasted on bulls*** :S

Thanks Talinon

Andreas94 started a new conversation Syntax Error, Unexpected '(', Expecting Identifier (T_STRING) Or Variable (T_VARIABLE) Or '{' Or '$'

What's wrong? I really can't understand...

if (GDPR::where('id_user', Auth::user())->('type', '1')->exists())
    {
      GDPR::where('id_user', $user->id)->('type', '1')->update(['status'=>$request->get('gdpr_newsletter')]);
    } else {
      $gdpr = new GDPR();
      $gdpr->user_id = Auth::user();
      $gdpr->type = 1;
      $gdpr->status = $request->get('gdpr_newsletter');
      $gdpr->save();
    }

Error: http\Controllers\ProfiloController.php156

156 if (GDPR::where('id_user', Auth::user())->('type', '1')->exists())

06 Aug
1 month ago

Andreas94 left a reply on Difficulty In Sending Text From The Editor MD To The Post Controller

in the controller? because I just can't pass the data, if I try to send it as the js as in the example:

[23:43:30] LOG.info: The given data was invalid. {"url":"http:\/\/127.0.0.1:8000\/admin\/articoli\/edit\/7234","previus":"http:\/\/127.0.0.1:8000\/admin\/articoli\/edit\/7234","input":{"_token":"8jmiOAam4WVOPNrtirYMgkQxhkddA8Jh3LRtC6Oo","titolo":"example md","slug":"example-md","game_p":"0","console_p":"0","tag":"as","gallery":null,"video":null,"fonte":null,"published_at":"2019-08-06 21:48:16","id_autore":"261","id_evento":"0","is_published":"0","immagine_manager":null}}

as you can see, "testo" is missing

Andreas94 started a new conversation Difficulty In Sending Text From The Editor MD To The Post Controller

Hi guys, I have successfully installed the Toast UI Editor MD, but I have problems sending data to the database.

Until now I have always had to do with input and textarea and it was enough for me to set the correct name, but how can I do now that the editor uses a div?

  var initial_form_state, last_form_state;
  var editor = new tui.Editor({
    el: document.querySelector('#editSection'),
    language: 'it_IT',
    initialEditType: 'markdown',
    previewStyle: 'tab',
    height: '500px',
    events: {
        change: function() {
          last_form_state = $('form').serialize();
        }
    }
  });

with console.log(editor.getValue()); I can receive the markdown data, but how do I send them to the post request?

Andreas94 left a reply on How Do I Get Data From Toast UI Editor?

No idea? for now I did

  $(document).on("submit", "form", function(event) {
    $('[name=document__text]').attr('value', editor.getMarkdown());
    $(window).off('beforeunload');
  });
    <div id="editor"></div>
    <input type="hidden" name="testo" />

But I don't think it's the right way even if it works

05 Aug
1 month ago

Andreas94 started a new conversation How Do I Get Data From Toast UI Editor?

Hi guys, I have correctly installed Toast UI Editor, but I have problems saving the markdown text in the database

      var initial_form_state, last_form_state;
      var editor = new tui.Editor({
        el: document.querySelector('#editSection'),
        language: 'it_IT',
        initialEditType: 'markdown',
        initialValue: determineValue(this.props),
        previewStyle: 'tab', //vertical
        height: '600px',
        events: {
            change: function() {
              last_form_state = $('form').serialize();
            }
        }
      });

How do I save the text in the db? so far with CKeditor it was enough to indicate the name, but here it does not use a textarea but a div...

04 Aug
1 month ago
03 Aug
1 month ago

Andreas94 left a reply on Best Practice To Manage Css And Js By Url

I already use the blade component but it becomes dispersive when you go to change or add a plugin.

I found this laravel/packer, what do you think? honestly I wouldn't want to use VUE, also because I would like to load the plugins only when needed and not always call them in all the pages...

i have plugins like ckeditor, select2, dropzone, ckfinder, lightgallery, flatpickr, easypiechart, noty and many others that are recalled in 8 blades of about 20.

if (\Request::is('article/*')) {
  $css  =   "...";
  $js   =   "...";
} elseif (\Request::is('review/*')) {
  $css  =   "...";
  $js   =   "...";
}

use this method? is it too rough?

Andreas94 started a new conversation Best Practice To Manage Css And Js By Url

Hi guys,

Which is the best practice to manage js and css for url? for example, I have lots of JS plugins that need to appear only on certain pages like CKEditor, Select2 etc...

I currently use the @yield('css') and @yield('js')but now that I have to change the editor I find myself having to intervene in so many blades...

I had thought of creating a controller that depending on the url recalls the specific js and css, so I have all the css and js called in a single file, making the changes and additions easier.

What is your advice?

07 Jul
2 months ago

Andreas94 started a new conversation Tracing Back To The Id Generated By An Insert

Hi guys, I'm catching on IP.Board to my laravel project, I need to insert queries without having to create a model.

I inserted in my post:


      \DB::table('forums_topics')->insert([
        'title'      => $articoli->titolo,
        'state'             => "open",
        'last_post'      => Carbon::now()->timestamp,
      ]);

but I need to get the id generated to insert it in this new query:

      \DB::table('forums_posts')->insert([
        'author_id'      => Auth::user()->id,
        'author_name'             => Auth::user()->username,
        'post_date' => Carbon::now()->timestamp,
        'post' => $request->get('testo'),
        'topic_id' => HERE
      ]);

in a simple new query I would have recalled the save() variable, but how can I do it here?

15 Jun
3 months ago

Andreas94 started a new conversation Delete Query After Checkbox Not Work

Hi guys, I have a list of elements, that if checkboxes are flagged, these elements must be eliminated otherwise you proceed with the change of the other fields:

  public function postOrderDLC(Request $request, $giocoId) {
    $giochi_dlc = GiochiDLC::where('id_gioco_main', $giocoId)->get();

    foreach ($giochi_dlc as $value) {

      if( Input::get('delete'.$value->id, false)) {

        GiochiDLC::where('id', $value->id )->delete();

      } else {

        $value->order = $request->get('order'.$value->id);
        $value->save();
      }

    }
    return \Redirect::back();

  }

        @foreach ($giochi_dlc as $value)

        <tr>
          <th scope="row">
            <div class="custom-control custom-checkbox">
              <input type="checkbox" class="custom-control-input" id="delete{{$value->id}}">
              <label class="custom-control-label" for="delete{{$value->id}}"></label>
            </div>
          </th>
          <td>{{$value->gioco->nome}}</td>
          <td><input type="text" class="form-control col-2" name="order{{$value->id}}" value="{{$value->order}}"></td>
        </tr>
          @endforeach

the fields are updated correctly whereas instead, even if I put the flag in a checkbox, the element is not deleted ... why? where am I wrong? This is a post request.

14 Jun
3 months ago

Andreas94 started a new conversation How To Send A Post Request In Dynamic Input Fields

Hi everyone,

It's been a while since I'd like to integrate dynamic input fields into my project as you can see in this example:

http://jsfiddle.net/lemonkazi/re8e2yov/

The question I have always asked myself is: How can I send a post request?

Up until now I have always taken the name which is unique and I put it in the post controller with a get request, how do you behave in these cases?

10 Jun
3 months ago

Andreas94 left a reply on Error Composer When I Add A Repository

Ok no, i have again this problem.

but now:

Using version ^1.2 for toolkito/larasap
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove laravel/framework v5.8.0
    - Installation request for laravel/framework (locked at v5.8.0, required as 5.8.*) -> satisfiable by laravel/framework[v5.8.0].
    - Conclusion: don't install illuminate/support v5.8.0
    - Conclusion: don't install laravel/framework v5.8.0
    - toolkito/larasap V1.2.2 requires illuminate/support 5.5.x|5.6.x -> satisfiable by illuminate/support[5.5.x-dev, 5.6.x-dev].
    - toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> satisfiable by illuminate/support[5.6.x-dev, 5.7.x-dev].
    - don't install illuminate/support 5.5.x-dev|don't install laravel/framework v5.8.0
    - don't install illuminate/support 5.6.x-dev|don't install laravel/framework v5.8.0
    - don't install illuminate/support 5.7.x-dev|don't install laravel/framework v5.8.0
    - Installation request for illuminate/support 5.8 -> satisfiable by illuminate/support[v5.8.0], laravel/framework[v5.8.0].
    - Installation request for toolkito/larasap ^1.2 -> satisfiable by toolkito/larasap[V1.2.2, V1.2.3].


Installation failed, reverting ./composer.json to its original content.

maybe it is not comaptibile with laravel 5.8?

Andreas94 left a reply on Error Composer When I Add A Repository

@VAN1310 - thank you very much solved only with:

"illuminate/support": "5.8",

Andreas94 started a new conversation Error Composer When I Add A Repository

I get this error when I try to add this repo to my composer:

https://github.com/alihesari/laravel-social-auto-posting

  Problem 1
    - Conclusion: remove laravel/framework v5.8.20
    - Conclusion: don't install laravel/framework v5.8.20
    - toolkito/larasap V1.2.2 requires illuminate/support 5.5.x|5.6.x -> satisfiable by illuminate/support[5.5.x-dev, 5.6.x-dev, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].
    - toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> satisfiable by illuminate/support[5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - don't install illuminate/support 5.5.x-dev|don't install laravel/framework v5.8.20
    - don't install illuminate/support 5.6.x-dev|don't install laravel/framework v5.8.20
    - don't install illuminate/support 5.7.17|don't install laravel/framework v5.8.20
    - don't install illuminate/support 5.7.18|don't install laravel/framework v5.8.20
    - don't install illuminate/support 5.7.19|don't install laravel/framework v5.8.20
    - don't install illuminate/support 5.7.x-dev|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.0|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.16|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.17|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.2|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.28|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.33|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.34|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.35|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.36|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.37|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.39|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.40|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.41|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.43|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.5.44|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.0|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.1|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.10|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.11|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.12|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.13|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.14|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.15|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.16|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.17|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.19|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.2|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.20|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.21|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.22|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.23|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.24|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.25|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.26|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.27|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.28|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.29|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.3|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.30|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.31|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.32|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.33|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.34|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.35|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.36|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.37|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.38|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.39|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.4|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.5|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.6|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.7|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.8|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.6.9|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.0|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.1|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.10|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.11|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.15|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.2|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.20|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.21|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.22|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.23|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.26|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.27|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.28|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.3|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.4|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.5|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.6|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.7|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.8|don't install laravel/framework v5.8.20
    - don't install illuminate/support v5.7.9|don't install laravel/framework v5.8.20
    - Installation request for laravel/framework (locked at v5.8.20, required as 5.8.*) -> satisfiable by laravel/framework[v5.8.20].
    - Installation request for toolkito/larasap ^1.2 -> satisfiable by toolkito/larasap[V1.2.2, V1.2.3].


Installation failed, reverting ./composer.json to its original content.

My composer is currently:

    "require": {
        "php": "^7.1.3",
        "arrilot/laravel-widgets": "^3.12",
        "artesaos/seotools": "^0.12.1",
        "bkwld/croppa": "^4.7",
        "ecrmnn/laravel-https": "^1.0",
        "fideloper/proxy": "^4.0",
        "greggilbert/recaptcha": "dev-master",
        "intervention/image": "^2.4",
        "jenssegers/date": "^3.4",
        "laravel/framework": "5.8.*",
        "laravel/passport": "^7.2",
        "laravel/scout": "^3.0",
        "laravel/socialite": "^4.0",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "^5.8",
        "laravelium/feed": "3.1.*",
        "laravelium/sitemap": "3.1.*",
        "silviolleite/laravelpwa": "^1.0"
    },

Where is the error?

09 Jun
3 months ago

Andreas94 left a reply on Include Auth Or Personal Variable In Config.

I also have this problem, no idea?

17 May
3 months ago

Andreas94 started a new conversation Error Unable To Prepare Route [api/user] For Serialization. Uses Closure.

Hi guys, I have been carrying this error for several months, which is not a problem but I want to solve it:

In Route.php line 917:

  Unable to prepare route [api/user] for serialization. Uses Closure.

I read that you have to comment on the code in route / api.php

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

after giving the command php artisan route:cache

But now I get the error:

In Route.php line 917:

  Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Closure.
08 May
4 months ago

Andreas94 left a reply on Edit Delete Permissions In Package Chatter

no idea to add this feature?

07 May
4 months ago

Andreas94 started a new conversation Edit Delete Permissions In Package Chatter

I state by saying that I have also opened a ticket on github hoping for a response from the developer, but this one does not arrive and since this site uses this packages, I hope you can help me.

The packages I'm talking about is: thedevdojo/chatter

I just installed Chatter in my Laravel 5.7 and wanted to include moderation features. In my configuration the permissions are:

$user->role 1 -> user $user->role 2 -> editor $user->role 3 -> moderator $user->role 4 -> admin

I have seen that only the message owner can modify or delete the message and if I have not seen badly, it is the function destroy in ChatterPostController.php

        $post = Models::post()->with('discussion','user')->findOrFail($id);

        if ($request->user()->id !== (int) $post->user_id && $request->user()->role === '1') {
            return redirect('/'.config('chatter.routes.home'))->with([
                'chatter_alert_type' => 'danger',
                'chatter_alert'      => trans('chatter::alert.danger.reason.destroy_post'),
            ]);
        }

        if ($post->discussion->posts()->oldest()->first()->id === $post->id || $post->user->role === '4') {
            if(config('chatter.soft_deletes')) {
                $post->discussion->posts()->delete();
                $post->discussion()->delete();
            } else {
                $post->discussion->posts()->forceDelete();
                $post->discussion()->forceDelete();
            }

            return redirect('/'.config('chatter.routes.home'))->with([
                'chatter_alert_type' => 'success',
                'chatter_alert'      => trans('chatter::alert.success.reason.destroy_post'),
            ]);
        }

But if I have messages in the topic:

ID 1 ID 1 ID 7

(And I'm ID 7)

when I delete the second ID1 message, my message (ID7) is also deleted.

Is it possible that there is no integrated moderation system in the forum system?

30 Apr
4 months ago

Andreas94 left a reply on Page Not Displayed In Public/forum

I discovered that the error is when I activate the IP.Board Rewrite URLS and I enter the provided htaccess

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /forum/404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>

what can it be that creates problems?

27 Apr
4 months ago

Andreas94 left a reply on Page Not Displayed In Public/forum

@BOBBYBOUWMANN - Root


<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^ [N]

    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/ 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ server.php

</IfModule>

Public


<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ / [L,R=301]

    RewriteCond %{HTTP_HOST} ^www\.domain\.net [NC]
    RewriteRule ^(.*)$ https://domain.net/ [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

</IfModule>
26 Apr
4 months ago

Andreas94 left a reply on Page Not Displayed In Public/forum

hi @bobbybouwmann , I added the string 20 but it still doesn't display the page

Andreas94 started a new conversation Page Not Displayed In Public/forum

Hi everyone, I was thinking of creating a forum in InvisionPower by creating a SSO system for my Laravel project but I can't understand why the files in / public / forum are not shown.

If I create an index.html file and visit / forum I will be shown a blank page, while if I visit /forum/index.html the correct file will be shown...

With this problem I can't install the board properly.

what is a problem with the Laravel htaccess?

20 Apr
4 months ago

Andreas94 left a reply on &#039; When Saved In The Db

@BOBBYBOUWMANN - in my blade I already use {{$value->giochi->nome}} but I still see the symbols.

I tried to do in php:


      $trophy->nome = htmlspecialchars($name_clear);
      $trophy->save();
      $trophy->slug = $trophy->id.'-'.Str::slug($trophy->nome, '-');
      $trophy->save();

but it continues to save me symbols both in the name and in the slug

fixed with

      $trophy->nome = html_entity_decode( $name_clear, ENT_QUOTES );

Andreas94 started a new conversation &#039; When Saved In The Db

in the admin of my site I added the simple dom HTML library to extract data, but i have a big problem.

in the site where I extract the data, there is a sentence with the apostrophe, only that I save it in html entities.

site:

Demone dell'odio

my site:

<td>Demone dell&amp;#039;odio</td>

how do I make the symbol appear and not the entity? because it also saves me in the slug..

this is my code:

      $name_clear = preg_replace('/\s+/', ' ', $value->find('div.trophy-title', 0)->plaintext);

      $trophy->nome = $name_clear;
06 Jan
8 months ago

Andreas94 left a reply on Error With Relationship Instance

@ADAMPRICKETT - Yes, the fields is:

{
id: 4277,
id_gioco: 100,
id_pub: 20,
nome: "Westworld",
website: "http://www.wbgames.com/",
logo: "",
data_in: "",
data_out: "",
slug: "110-westworld",
created_at: "2018-06-21 16:05:09",
updated_at: "2018-06-21 16:05:36",
publisher: "20",
copertina: "1706266855-copertina.jpg",
},

If I understood correctly, I was telling myself to do:

        public function getCopertinaAttribute()
      {
            if(!empty($this->attributes['copertina'])) {
                if(file_exists(public_path('upload/copertina/'.$this->attributes['copertina'])))    {
            return 'upload/copertina/'.$this->attributes['copertina'];
            }    else    {
            return 'upload/listagiochi.png';
          }
            }   else    {
                 return 'upload/listagiochi.png';
             }
      }

but to recall it in the blade? $value->copertina() ?

Andreas94 started a new conversation Error With Relationship Instance

Hello everyone, I have updated my Laravel from 5.4 to 5.7, everything works fine, I have adapted the code by removing and replacing the deprecated codes... But...

But I have a problem on one page and I can not get through it:

Models\Publisher

        public function copertina()
      {
            if(!empty($this->copertina)) {
                if(file_exists(public_path('upload/copertina/'.$this->copertina)))  {
            return 'upload/copertina/'.$this->copertina;
            }    else    {
            return 'upload/listagiochi.png';
          }
            }   else    {
                 return 'upload/listagiochi.png';
             }
      }

Controller

            $publisher = Publisher::where('slug', $slug)->first();
            $publisher_pivot = \App\Models\Publisher_pivot::join('publisher', 'publisher_pivot.id_pub', '=','publisher.id')
                                                        ->join('giochi', 'publisher_pivot.id_gioco', '=', 'giochi.id')
                                                        ->join('info_giochi', 'publisher_pivot.id_gioco', '=', 'info_giochi.id_gioco')
                                                        ->where('id_pub', $publisher->id)
                                                        ->groupBy('info_giochi.id_gioco')
                                                        ->orderBy('data')
                                                        ->get();

Blade

      @foreach ($publisher_pivot as $value)
            <img src="{{url($value->copertina())}}" alt="{{$value->nome}}"> </div>
      @endforeach

I receive the error: App\Models\Publisher::copertina must return a relationship instance. (View: C:\xampp\htdocs\lv\resources\views\front\pages\company\pub.blade.php) How ever updating my laravel, do I have this problem? I've done some research that takes me on stackoverflow, but they do not help me to deal with it

01 Aug
1 year ago

Andreas94 started a new conversation Create Queries For Each Value Selected In The Multiselect

Hello everyone, I have a problem ... For every option I select in the multiselect, I would need to create a query in pivot_quest, both in two different queries, unfortunately I get the error:

Array to string conversion (SQL: insert intopivot_quest(id_quest,id_user,exp,salary,updated_at,created_at) values (0, 1, 0, 0, 2018-08-01 19:19:43, 2018-08-01 19:19:43))

This is my code:

Blade:

                    <select name="id_user[]" class="form-group" multiple>
                      @foreach ($user as $value)
                        <option value="{{$value->id}}"> {{$value->username}}</option>
                      @endforeach
                    </select>

Controller:

    $id_users = (array)$request->get('id_user');

    foreach ($id_users as $value) {
      $pivot_quest = new Pivot_Quest();
      $pivot_quest->id_quest = $request->get('id_quest');
      $pivot_quest->id_user = $request->get('id_user');
      $pivot_quest->exp = '0';
      $pivot_quest->salary = '0';
      $pivot_quest->save();
    }

Where am I doing wrong?

28 Jul
1 year ago

Andreas94 started a new conversation Request Ajax Never Receives Error

Hi everyone, I've created an ajax request with integrated Notquery jquery notifications, only I can never get an error.

    public function postPurchase(Request $request)  {
        #I take the item to buy
          $object = Objects::where('id', $request->input('id_obj'))->first();

          #I check the money that is left to the user after the purchase
          #I look at if the user has the money for the purchase
          $rest = Auth::user()->money - $object->price;

          if($rest >= "0" || Auth::user()->money > $object->price) {
            $logpurchase = new  LogsPurchase();
            $logpurchase->id_user = Auth::id();
            $logpurchase->id_obj = $request->input('id_obj');
            $logpurchase->money = $object->price;
            $logpurchase->save();
            #I update the user's money in the user table
            User::where('id', Auth::id())->update(['money' => $rest]);

            $response = array(
              'status' => 'success',
              'msg' => $request->message,
            );
            return response()->json($response);
          } else {
            $response = array(
              'status' => 'error',
              'msg' => $request->message,
            );
            return response()->json($response);
          }
    }

Ajax:

<script type="text/javascript">
  $(function() {

    var id_obj = {{$value->id}};
      $("#{{$value->id}}").click(function(e) {
          $.ajax({
              type: "GET",
              url: "{{url('ajax/purchase')}}",
              cache:false,
              data: {
                id_obj: id_obj,
              },
              success: function(response) {
                console.log("success");
                    $("#{{$value->id}}").attr('disabled', true);
                    new Noty({
                      type: 'success',
                      layout: 'topRight',
                      type: 'info',
                      theme: 'mint',
                      layout: 'topRight',
                      timeout: 4000,
                      text: 'You have just bought {{$value->name}}.'
                    }).show();

            },
              error: function(response) {
                console.log("error");
                $("#{{$value->id}}").attr('disabled', true);
                new Noty({
                  type: 'error',
                  layout: 'topRight',
                  type: 'info',
                  theme: 'mint',
                  layout: 'topRight',
                  timeout: 4000,
                  text: 'Error, you could not buy {{$value->name}}.'
                }).show();
              }
          });
      });
  });
</script>

Every time the user clicks the button, even if he does not have the money, in the console of chrome appears success and never error, how can I get the error generated? Where am I doing wrong?

17 Jan
1 year ago
16 Jan
1 year ago

Andreas94 left a reply on Which Session Driver Do You Recommend?

I bring this discussion back to life a few weeks ago. I set 120 as suggested by @Snapey, unfortunately, however, users find themselves having to log in to the site several times a day... how can I avoid this?

08 Jan
1 year ago

Andreas94 left a reply on Which Session Driver Do You Recommend?

I'm not hiding anything... I simply do not understand why it saves every single session and page visited, these are some contents of the files:

a:3:{s:6:"_token";s:40:"l5bbPnKcUdloPAwKSyO0qMkgpdZK83KIGBFo8t8f";s:9:"_previous";a:1:{s:3:"url";s:63:"/trofei/viva-ferrari";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
a:3:{s:6:"_token";s:40:"Rp4wEKoHQiOh4E1chSWMxmufbVgJRQjRtxnoDbOS";s:9:"_previous";a:1:{s:3:"url";s:147:"nuovo-trailer-di-sid-meiers-civilization-vi-rise-and-fall";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}

Honestly, I do not even understand what it means:

s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}

This is my Session.php file:

return [
    'driver' => env('SESSION_DRIVER', 'file'),
    'lifetime' => 525600, // 1 year
    'expire_on_close' => false,
    'encrypt' => false,
    'files' => storage_path('framework/sessions'),
    'connection' => null,
    'table' => 'sessions',
    'store' => null,
    'lottery' => [2, 100],
    'cookie' => 'ge_user_session',
    'path' => '/',
    'domain' => env('SESSION_DOMAIN', null),
    'secure' => env('SESSION_SECURE_COOKIE', false),
    'http_only' => true,
];

Edit: I just found this old thread "https://laracasts.com/discuss/channels/laravel/thousands-of-files-in-session-folder" I try to see if I solve it too ...

Andreas94 left a reply on Which Session Driver Do You Recommend?

No, In domain I have:

'domain' => env('SESSION_DOMAIN', null),

and in the env it is not reported, so it is null...

Now i have 9998 file for 2348450 bytes = 2,34 megabytes

07 Jan
1 year ago

Andreas94 left a reply on Which Session Driver Do You Recommend?

In 5 hours, 3912 files... Is this normal?

Andreas94 left a reply on Which Session Driver Do You Recommend?

@Snapey What are the file sessions to contain? only when a user logins in?

Because to me is also saved every page that the user visits, example:

a:3:{s:6:"_token";s:40:"2J2Y6YfFMO8ZuqWV64bnuw36L8Uymq4h78aBMn75";s:9:"_previous";a:1:{s:3:"url";s:28:"/rss.php";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
a:3:{s:6:"_token";s:40:"2mUfgeulnmhGN0eS1jAXxEYEZdV3aiLnnMRAARbl";s:9:"_previous";a:1:{s:3:"url";s:61:"giochi/the-witness-pc/gallery";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}

Why this thing? I just reactivated the Sessions with files and I already have 143 files...

@Shez1983 If the user deletes cookies it is because he wants to remove access ... But how come you say that they are few sure?

06 Jan
1 year ago

Andreas94 left a reply on Which Session Driver Do You Recommend?

It is a site with about 4700 unique visits a day @gator, if I set "lifetime" in config/session.php, with an expiration of about 43200 minutes = 30 days, the storage/framework /session directory is emptied every month, but then all users every thirty days have to re-login.

Realize that I have converted my portal in Laravel for about 6 days ... In a week that folder weighed 10MB and inside there were more than 150k files... If I had to put it every 30 days the folder would explode...

But what are these files for? everything that users do on the site or just logins?

@shez1983 And selecting cookies, how do you save the same data I'm saving now with files?

Andreas94 started a new conversation Which Session Driver Do You Recommend?

Hello everyone, at the moment I use the Session Drive "file", but unfortunately the folder / storage/framework/sessions now weighs more than 10MB and has in many files...

What do you recommend? which one do you use? Is it safe to use cookies?