diegoaurino

diegoaurino

Member Since 1 Year Ago

web programmer at ~

Experience Points 166,670
Experience Level 34

3,330 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 1521
Lessons
Completed
Best Reply Awards 23
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.

18 Aug
15 hours ago

diegoaurino left a reply on Restrict Access To Website By Location.

Hello, @khaledz !

You can use the Google Geolocation API to implement this.

Hope this helps. Let me know.

15 Aug
3 days ago

diegoaurino left a reply on How To Make Each Authenticated User Only See Their Own Product

Also, you can combine global scopes, as @snapey suggested, with Policies. So, check Authorization & Policies in the docs.

Hope this helps. Let me know.

diegoaurino left a reply on ASP VS PHP

What? ūüėĪ

13 Aug
5 days ago

diegoaurino left a reply on TokenMismatch - With Multiple Laravel Projects On One Server

Hello, @martinzeltin !

Are those Laravel "projects" sharing the same domain? In this case, I believe you need to use Redis driver instead of the default file session. Look for Redis sessions in the docs.

As I don't have any idea about how your web server is configured, it is hard to say if it is related to a wrong Apache configuration, for example. In some cases, you need to correctly use mod_rewrite to make it works well with Apache. I do not recommend you to edit your .htaccess to use RewriteBase. So, check it too.

Make sure the APP_NAME is properly set for each "project" because the SESSION_COOKIE will rely on this.

Also, check the following in the config/session.php:

/*
    |--------------------------------------------------------------------------
    | Session Cookie Path
    |--------------------------------------------------------------------------
    |
    | The session cookie path determines the path for which the cookie will
    | be regarded as available. Typically, this will be the root path of
    | your application but you are free to change this when necessary.
    |
    */

Hope this helps. Let me know.

12 Aug
6 days ago

diegoaurino left a reply on I Want To Create One To Many Relationship In Between Country State And City, How Can I Declare The Foreign Key Please Suggests Me How To Do?

Hello, @kanchan186 !

Check the docs for one-to-many relationships.

Also, take a look at the Laravel from Scratch series. Jeffrey covers the most basic relationships there.

After a quick read in the docs, you will be able to create those relationships with ease, I guess. It is very straightforward.

If you can get a paid account, you can also do the Eloquent Relationships serie. All eloquent relationships are covered there.

Hope this helps. Let me know.

11 Aug
1 week ago

diegoaurino left a reply on Laravel Saves MP3 Files As MPGA

Hello, @dimasoliveira & @markandrewkato !

Check the /vendor/symfony/mime/MimeTypes.php class. You will see the following:

'audio/mpeg' => ['mpga', 'mp2', 'mp2a', 'mp3', 'm2a', 'm3a'],

Laravel does not convert .mp3 files to .mpga. It is only related to the Mime type that .mp3 is associated with. If you look at the array above, you will see that its extension is only the 3rd item in the list. So, the application renames the file to match the first file extension in the array.

Hope this helps. Let me know.

06 Aug
1 week ago

diegoaurino left a reply on Scout ToSearchableArray Doesn't Get Relations When Save From Nova

Hello, @msassa & @MiguelStevens!

Check my answer in this issue on Scout Github repo.

Basically, I said:

___++++

I was facing a similar problem these days (with Algolia). The problem is that, for some reason, Scout appears to ignore relationship synchronizations on the store method. It looks like the sync() method does not change (touches) the timestamp of the model object that has been created on the store method in question.

$touches looks to be a solution for those that are not syncing or attaching, but creating or updating the synced objects.

A small workaround, I did, was to touch() the object, what will update its timestamp. Then Scout will pick the relationship too. But you cannot do that on the store method; it will happen so quickly that the timestamp will not change.

A workaround is to add an event and a listener for the store method. Then, you only need to use the last one to trigger a job that will touch your model object. The job should be delayed at least 1 (one) minute. That appears to be enough for Scout to pick the new timestamp and index the object with the relationship. That approach does not interfere with the user experience because the job will be handled behind the scene.

In other words, it does not look like a Scout bug, but only a thing to be aware of.

Hope this helps someone!

___++++

Hope this helps. Let me know.

diegoaurino left a reply on Help

Hello, @ronzxc1998 !

What browser are you using? What is your OS?

In some cases, you need to install codes to run videos depending on the browser and OS you are using. For example, if you are using Chromium-based browsers on Ubuntu-based distros, you need to install:

sudo apt install libavcodec-extra chromium-codecs-ffmpeg-extra ubuntu-restricted-extras

Thus, make sure your browser and OS are okay.

Hope this helps. Let me know.

04 Aug
2 weeks ago

diegoaurino left a reply on Why Page Route Not Working Properly. "404 | NOT FOUND!''

Hello, @aqansari !

Are you using Apache or Nginx? What is your OS? How your webserver is configured?

Are you getting 404 from the web server or from the application?

In case you are getting this error for the webserver, you need to check if the configuration is okay and if all necessary modules are active. Considering Apache, for example, check if mod_rewrite is active.

Hope this helps. Let me know.

03 Aug
2 weeks ago

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

Hello, @Andreas94 !

I don’t know if your project has restrictions to use Vue. I believe the easier approach is to wrap the editor inside a Vue component. Thus, you can use it anywhere without caring about how blade would manage those scripts. Also, check that there is an official CKEditor component for Vue: https://github.com/ckeditor/ckeditor5-vue  

Another option is to create a blade component. https://laravel.com/docs/5.8/blade#components-and-slots 

Hope this helps. Let me know.

25 Jul
3 weeks ago

diegoaurino left a reply on Vapor - Taylor Otwell Presentation

Very promising ūüėé

24 Jul
3 weeks ago

diegoaurino left a reply on Laravel + VueJS (SEO And PageSpeed Insight)

Hello, @florent6001 !

I recommend you watch this video from the official Google Webmasters channel: https://www.youtube.com/watch?v=Op8Q8bUAKNc 

In case you are building a SPA, you can use vue-meta to manage your HTML meta-tags. Otherwise, you can use Blade to set them dynamically. 

JavaScript engines are very fast, but it also will depend on the quality of your code.

Hope this helps. Let me know.

21 Jul
4 weeks ago

diegoaurino left a reply on PHPUnit Not Running From Vendor/bin Folder (Composer Install)

Hello, @pedroroccon !

What happens if you run composer install?

Are you running PHPUnit from the command line or from an IDE?

Check if your IDE is configured to use the proper phpunit.xml from the project's root folder and the autoload.php included in the /vendor folder. Also, check if you are calling PHPUnit from /vendor/bin/phpunit included in your app installation and not from other installation or even from a global installation on your OS in case you are using the command line.

And what do you mean by you are using vendor/bin/phpunit vendor/pedroroccon/my-package? Are you using PHPUnit to run a folder you placed inside the /vendor directory? If so, I am afraid your default PHPUnit configuration will not understand this. 

Hope this helps. Let me know.

15 Jul
1 month ago

diegoaurino left a reply on Asset() Work With Localhost , Not With Domain.local

Hello, @moukbel !

Follow the suggestions above, but also update your httpd-vhosts.conf to:

<VirtualHost *:80>
    ServerName myproject.local
    ServerAlias www.myproject.local

    ServerAdmin [email protected]
    DocumentRoot "C:/wamp64/www/laravel/myproject/public"

    <Directory "C:/wamp64/www/laravel/myproject">
        AllowOverride All
    </Directory>
</VirtualHost>

Then, restart all the servers. Also make sure you are not receiving ports collisions from other Windows apps like Skype etc.

Hope this helps. Let me know.

diegoaurino left a reply on Vue Select: How Do I Mark An Option As Selected Dependant On Id?

Hello, @finchy70 !

You are using prelim in this.prelimdata in the v-for. You don't need to use this to access the prelimdata array inside the template.

Also make sure the server response is returning the correct data.

Hope this helps. Let me know.

13 Jul
1 month ago

diegoaurino left a reply on Can't Get Vagrant Up

Hello, @paulgureghian !

Check this issue on Github: https://github.com/hashicorp/vagrant/issues/1671

The "failed to open /dev/vboxnetctl" problem is well known. There are some workarounds to mitigate the problem.

If you are accessing the VM remotely, also make sure the required ports are available.

Hope this helps. Let me know.

07 Jul
1 month ago

diegoaurino left a reply on Same Array But Not

Are you mutating the original array?

diegoaurino left a reply on Same Array But Not

Hello, @kidi !

Is the screenshot a console.log output for this.cart? How does it look like in your code?

diegoaurino left a reply on Laravel And Vue (in Forms)

Hope you are doing great.

I am not sure whether I understood your question or not. However, you can wrap only the multiselect component in other component. Then, you can easily emit only the filtered array you need. Also, you can massage your date in your controller to fit you need.

06 Jul
1 month ago

diegoaurino left a reply on Laravel And Vue (in Forms)

Hello, @zfdeveloper !

You don't need to create a new component to use vue-multiselect and you can use it directly inside your form in Blade. You will need to create a few methods in your Vue instance in the app.js file though. Those methods will be responsible for consuming the API and setting the options for the selection.

A general example would look like this:

inside you Vue instance ---

       data() {
            return {
                options: [],
            }
        },
        created() {
            this.getTags();
        },
        methods: {
            getTags() {
                axios.get('/api/admin/tags').then(response => {
                    this.options = response.data;
                })
            }
        },

And in your form ---

        <multiselect
            class=""
            v-model="tags"
            placeholder="Search a tag"
            label="name"
            track-by="name"
            :options="options"
            [...]>
        </multiselect>

That is just an example to give you an idea. Don't forget to properly import the libraries. There are plenty of examples on the internet, especially in Codepen, where people configure vue-multiselect directly in the Vue instance. But it is important to know that you Vue instance will get messy very, very quickly though.

Hope this helps. Let me know and good luck!

diegoaurino left a reply on Laravel Scout - The Relationship Is Not Added At Creation

I was facing a similar problem these days (with Algolia). The problem is that, for some reason, Scout appears to ignore relationship synchronizations on the store method. It looks like the `sync( method does not change (touches) the timestamp of the model object that has been created on the store method in question. 

$touches looks to be a solution for people that are not syncing or attaching but creating or updating the synced objects.

A small workaround, I did, was to touch() the object, what will update its timestamp. Then Scout will pick the relationship too. But you cannot do that on the store method; it will happen so quickly that the timestamp will not change.

A workaround is to add an event and a listener for the store method. Then, you only need to use the last one to trigger a job that will touch your model object. The job should be delayed at least 1 (one) minute. That appears to be enough for Scout to pick the new timestamp and index the object with the relationship. That approach does not interfere with the user experience because the job will be handled behind the scene.

In other words, it does not look like a Scout bug, but only a thing to be aware of.

Hope this helps someone!

05 Jul
1 month ago

diegoaurino left a reply on Can't Connect To Algolia .

Hello, @saberhosneydev !

Have you properly set the ALGOLIA_APP_ID variable in your .env file? Share more details of your set up!

02 Jul
1 month ago

diegoaurino left a reply on How Do I Keep Getting Hacked On PHPUnit?

Hello, @mchiasson !

It is hard to say based on the information you are providing.

What do you mean by ".htaccess restrictions to block .ENV"? You should expose only the public folder and properly set the permissions for this folder. That is the most basic thing you can do.

Also, from a sysadmin point of view, relying only on a custom .htaccess configuration is a bad idea. You need to properly set up your web server (Apache or Nginx) to secure the Laravel root directory and only expose the public folder.

If the attacker has access to your vendor folder, he can use PHPUnit to trigger any PHP code via POST request.

I don't believe the problem is with PHPUnit however.

It is also important to upgrade your entire framework from time to time.

Hope this helps. Let me know.

diegoaurino left a reply on Laravel Dusk Ignoring Testing Database And Uses Main One Instead

@R123 - So, check the docs for Dusk: https://laravel.com/docs/5.8/dusk#environment-handling

It has its own way to handle env variables.

" if you will be initiating the dusk command from your local environment, you should create a .env.dusk.local file."

Also, make sure you removed the previous configuration.

Let me know if this helps.

01 Jul
1 month ago

diegoaurino left a reply on Laravel Dusk Ignoring Testing Database And Uses Main One Instead

@R123 - Take a look at the docs: https://laravel.com/docs/5.8/testing#environment

It says that:


you may create a .env.testing file in the root of your project. This file will override the .env file when running PHPUnit tests or executing Artisan commands with the --env=testing option.

That is the documented way of doing this. After you should add your database variables there and so on.

Then,

You are free to define other testing environment configuration values as necessary. The testing environment variables may be configured in the phpunit.xml file, but make sure to clear your configuration cache using the config:clear Artisan command before running your tests!

Also, check https://laravel.com/docs/5.8/configuration#environment-configuration

You may also create a .env.testing file. This file will override the .env file when running PHPUnit tests or executing Artisan commands with the --env=testing option.

So, you do not need to mess up your config files. Don't forget that you need to correct any miss configuration on your phpunit.xml file too. If needed, you can run php artisan config:cache --env=testing to clean up the cache.

Another option is to run tests in memory.

Hope this helps. Let me know.

diegoaurino left a reply on How To Find Storage Directory Cpanel/filezilla

It is not clear to me. But...

What do you mean by /public_html/\imagineprofi? There is a backslash before the i in imagineprofi. The shell will interpret the next character as a special character. Is that what do you want?

Is the /imagineprofil/ the root directory or the public folder?

30 Jun
1 month ago

diegoaurino left a reply on Getting All Json Instances From An Axios Response Dynamically

@LITTLEBOBY - Glad you solved it out! =D

Check: https://laravel.com/docs/5.8/eloquent-resources and https://laravel.com/api/5.8/Illuminate/Http/Resources/Json/JsonResource.html

It will give you a better understanding about what JsonResource is doing with your data. ;)

Please, mark it as solved!

diegoaurino left a reply on Getting All Json Instances From An Axios Response Dynamically

@LITTLEBOBY - Also, note that you defined your attributes like this in PHP:

            'attributes' => [
                'name' => $this->name,
                'description' => $this->description,
            ],

And the API response:

attributes:
description: "Esse doloremque iste aperiam atque minus ab illum dolores dignissimos amet illum voluptatem voluptas."
name: "Aliquam autem voluptas ipsa non."

Here you can see that it is an empty JSON key. So, if you chain it like attributes.name, you will get undefined.

Expand everything you see in your groups data in the Vue DevTools and paste it here. So, you can have a better idea of what v-for will give to you. Besides that, just put {{ group }} inside your v-for to see what you are getting there.

Good luck!

diegoaurino left a reply on Getting All Json Instances From An Axios Response Dynamically

@MSTRAUSS - No problem, @mstrauss . It was fun. :D

Besides what @mstrauss suggested, I would like to give some tips to you, @littleboby . 

It is hard to know, at least for me, where you want to go here. Your API response is not that clean. I would suggest you go to the controller and massage your API data before consuming it in the Front-End. You are using data.data to access the response; this chain is not a good sign.

You are using

v-for="group in groups"

to iterate over the groups object, it will create group with the associated value. But you are also defining group in your Vue data in one of your previous code. Why? Have you removed it?

Try to console.log the data you are applying to this.groups inside your response chain, see what you get. Also, go to your Vue.js devtools, click on the component in question and check what kind of data is stored on your groups data. You need to check if its content is iterable, otherwise the v-for will be blank.

Hope this helps!

diegoaurino left a reply on When To Use Components?

I would say it is okay if it fits your application architecture. Try to keep good programming principles in mind too. Also, note that components communication can get complicated if you are dealing with multiple components. In this last case, you will probably need to use Vuex to keep track of everything. Another important point is that every component has its own templates and styles; sometimes it can become hard to maintain if badly planned.

diegoaurino left a reply on Update Value Outside Component

@MARKOKAUP - Hello, @markokaup !

You don't need to use Vuex for simple things like that.

The proper way to communicate from parent to child in Vue is by using props, and from child to parent, you can emit an event or use an Event Bus.

The Vue documentation is really good to cover that. Do basic research about those terms, you will find multiple examples.

Also, here on Laracasts, you can find free lessons that cover virtually all aspects of this.

Check: https://laracasts.com/series/learn-vue-2-step-by-step

Hope this helps. Let me know. Good luck!

diegoaurino left a reply on Vue Is Not Rendering Youtube Video Correctly

Hello, @nhayder !

As I don't know what package are you using, I have some questions to try to guide you.

What package are you using? Have you properly import it?

Have you installed the¬†Vue.js devtools extension? If so, check if it is pointing out some problems. ¬† What your `console.log(‚ÄėFrom component =>‚Äė+response.datashowing to you?

Note that in the following code you will not be able to access your `medi data:

        .then(function (response) {

            console.log('From component =>'+response.data);

            this.media = response.data;

        })

You need to use the arrow function instead.

        .then(response => {

            console.log('From component =>'+response.data);

            this.media = response.data;

        })

Also, try to wrap your div with other div to avoid future problems.

I also see that you have multiple props for this component, but not all are in use.

Hope this helps you. Let me know.

diegoaurino left a reply on Getting All Json Instances From An Axios Response Dynamically

@MSTRAUSS - Just to clarify things and help here. The arrow function is called¬†‚Äúarrow function‚ÄĚ and not ‚Äúarrow scope function‚ÄĚ. The arrow function does not have it own this. For that reason, it will look for the enclosing lexical scope. In other words, it¬†automatically¬†gets the¬†lexical "this" . Check:¬†https://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions¬†

@littleboby In your previous code, this is not pointing to your Vue object, but to the global object. 

If you are not okay with using the arrow function, you can use the " .bind " utility, like " .bind(this) " after your function.

diegoaurino left a reply on Blade Layout Problem

@LEANSTI - Glad you solved the problem! Good luck! :)

diegoaurino left a reply on Blade Layout Problem

Hello, @leansti !

Are you just appending your HTML code on the default welcome.blade.php file? If so, note that it includes a div with the following classes: flex-center position-ref full-height. This div is wrapping other divs. Also, look at the style tag inside the head. You need to customize it.

Hope this helps. Let me know.

diegoaurino left a reply on Getting All Json Instances From An Axios Response Dynamically

Hello, @littleboby !

You need to use an arrow function to access the correct scope. For example:

            .then(response => {
                console.log(response.data.data[0].attributes.name); 
                this.groups = response.data.data[0].attributes; 
            })

Hope this helps. Let me know.

diegoaurino left a reply on PHPUNIT Fails, But Separate Testsuits Not

@BAHJAAT - Glad to see that! I didn't pay attention to the fact you were using 'DatabaseMigrations' instead of 'RefreshDatabase'. Did you properly set your testing database? Also, check the possibility of using the test in memory. It tends to be faster especially in Windows. If your project allows that, just add the following in you phpunit.xml:

        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>

But note that it will use sqlite in memory. Let the .env file to set only your main databases. Check if your antivirus or firewall is not slowing down the entire process. In general, tests running under a plain Apache and PHP installation on Windows, for example, tend to be really fast, but under WSL1 it is very, very slow.

Bests,

29 Jun
1 month ago

diegoaurino left a reply on PHPUNIT Fails, But Separate Testsuits Not

Hello, @bahjaat !

Are you running those tests from PHPStorm or from the command line?

Check if PHPStorm is configured to use the proper phpunit.xml and the autoload.php included in the /vendor folder. Also, check if you are calling PHPUnit from /vendor/bin/phpunit included in your app installation and not from other installation or even from a global installation on Windows in case you are using the command line.

In case the problem persists, paste here your .env and phpunit.xml files.

Hope this helps!

28 Jun
1 month ago

diegoaurino left a reply on Vue.js Activated In Tab: Npm Run Watch Build Successful, No Visual Feedback

@LITTLEBOBY - Glad to hear that! Please, mark it as solved! Good luck, @littleboby ! :)

diegoaurino left a reply on PHP Artisan Not Stopping

Hello, @joshuadabejero !

This is happening because when you press CTRL + C on Bash, it sends a SIGINT to the job running in the foreground. In other words, it interrupts the job on Bash but not the CMD.exe command that is running outside the WSL environment with the /C flags that says to the command run and then terminates itself when finished. The command will not terminate because it can't receive the SIGINT from bash.

Besides what @nash suggested, I would recommend you install the full LAMP inside WSL. So, you would have the best of XAMPP, but running natively inside WSL.

If your intention is to continue with your current environment, you can create a .bat script that is called by a specific alias that kills any php.exe instance that is running on Windows. Or more complexly, create a .ps1 scripts that run and watch the command it has called, thus it can kill those command when finished. But I believe the things start to be unnecessarily complex here.

Good luck!

diegoaurino left a reply on Vue.js Activated In Tab: Npm Run Watch Build Successful, No Visual Feedback

@LITTLEBOBY - Sure. You need to specify the id and not the class on Discover.html:


    <div id="app">
        <discover></discover>
    </div>

diegoaurino left a reply on Vue.js Activated In Tab: Npm Run Watch Build Successful, No Visual Feedback

Hello, @littleboby !

Try this on your Discover.vue component:

<template>
<div class="chat-app">
    <HeaderComponent></HeaderComponent>
</div>
</template>


<script>

import HeaderComponent from './HeaderComponent';

export default {
   components: {
      HeaderComponent
    },
    mounted() {
        console.log('Component mounted.')
    }
}


</script>

You are putting the components outside the export. Let me know if it helps you.

20 Jun
1 month ago

diegoaurino left a reply on Extended Latin Characters Missing On Save() - Laravel 5.8

@RICHARDEV - Are you using any of the str* (string) PHP functions before saving? Take a look at the entire path before saving. Paste here this path.

Some PHP string functions use the current locale. That is one reason why some mb_str* variants exist. https://www.php.net/manual/en/ref.mbstring.php

19 Jun
1 month ago

diegoaurino left a reply on Extended Latin Characters Missing On Save() - Laravel 5.8

@RICHARDEV - I am not a specialist in Baltic charsets for MySQL. But I know that MySQL had some problems with those related collations in older versions. Looking at the docs, MySQL 8.* made some improvements: 

Language specific Unicode 9.0 collations for Czech, Danish (also valid for Norwegian), German (phonebook order), Esperanto, Spanish, Spanish (traditional), Estonian, Croatian (also valid for Serbian with latin characters, and Bosnian), Hungarian, Icelandic, Lithuanian, Latvian, Polish, Romanian, Slovak, Slovenian, Swedish, Turkish, Vietnamese, Japanese (including kana sensitive collation), Chinese, and Russian (also valid for Bulgarian).

What version are you using on your local machine? Try to update to 8.* if you are running an older one. Also, try to use a specific charset and collation offered by the 8.* version to see whether it works or not. https://dev.mysql.com/doc/refman/8.0/en/charset-baltic-sets.html 

It is also easy and fast to set up SQLite or PostgreSQL with Laravel. So, it is an option to isolate the problem.

diegoaurino left a reply on Extended Latin Characters Missing On Save() - Laravel 5.8

@RICHARDEV - Did you check the config/database.php file? Check the charset and collation keys in the connections array.

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
        ],
18 Jun
2 months ago

diegoaurino left a reply on Extended Latin Characters Missing On Save() - Laravel 5.8

Hello, @richardev !

Did you check if the specific table and column are using another charset? Perhaps this table (or column) is using utf8 instead. You can use `information_schema to accomplish it. Look: https://dev.mysql.com/doc/refman/8.0/en/information-schema.html 

Columns, tables, and schemas of each database can have a different collation and charsets. So, I suggest you give it a try.

Hope this helps you.

22 May
2 months ago

diegoaurino left a reply on PHPUnit Will Not Use :memory: Database

@NEXXAI - Are you running those tests from the command line? Take a look at this line in your error: "/Users/nexxai/.composer/vendor/phpunit/phpunit/phpunit:61" . It is using the phpunit globally installed in your machine for your user and not the one used by the app installation in vendor/bin/phpunit. The configuration I showed you above is all you need to run tests in memory. Thus, make sure both your application configurations and your local machine (PHP, composer, etc) are correctly set. Also, if you are running these tests from an IDE, you need to configure it there as well to point the phpunit.xml and the composer autoload correctly. Another thing I noticed is that your composer installation is not using the standard folder for Windows. Make sure your composer variables are correctly set for your system.

diegoaurino left a reply on PHPUnit Will Not Use :memory: Database

@NEXXAI - In other words, just append the following inside the php key of your phpunit.xml file:

 <env name="DB_CONNECTION" value="sqlite"/>
 <env name="DB_DATABASE" value=":memory:"/>

diegoaurino left a reply on PHPUnit Will Not Use :memory: Database

Hello, @nexxai !

You need to add the ":memory:" not in your .env file, but in the phpunit.xml file. Like this:

    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="MAIL_DRIVER" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="TELESCOPE_ENABLED" value="false"/>
 </php>

So,

 <env name="DB_CONNECTION" value="sqlite"/>
 <env name="DB_DATABASE" value=":memory:"/>

Let the .env file to set only your main databases.

That is more than enough. You can also use the RefreshDatabase trait to avoid database persistent changes. If you are just starting a new project, undo your configuration and start again to avoid misconfigurations.

That is all I do to run tests in memory.

Hope this reply helps you. Let me know if so.