hollyit

Experience

8,500

4 Best Reply Awards

  • Member Since 1 Year Ago
  • 60 Lessons Completed
  • 0 Favorites

10th October, 2018

hollyit left a reply on Storage/app Not Readable CentOS • 4 days ago

@adjaf - You can look in /var/log/audit at the log files and see if there's anything from selinux in there. It can be a real pain to configure. It should be ok since the rest of the app is working, but if a flag somehow gets screwed up on a directory, then that causes headaches (you can view flags with ls -Z).

Before that though, I would double check users and permissions. /storage should have +rwx for user and group.

9th October, 2018

hollyit left a reply on Storage/app Not Readable CentOS • 5 days ago

Make sure that path is accessible by PHP (whatever user PHP is running as if using FPM, or the webserver is running as). On CentOS with SELinux, permissions are more sensitive (for good reasons).

hollyit left a reply on Uncaught ReferenceError: $ Is Not Defined At 10:503 • 5 days ago

It's not working because your inline script doesn't know what $ is yet. That's because you are deferring the load of it (the defer in the script tag). Browsers won't load/execute deferred scripts until after the page is loaded. Your inline script is going to execute before that. Even with $(document).ready, $ is still going to be undefined because jquery hasn't loaded yet.

Typically what I do is put all the scripts in the footer. If I need to call something from a partial, like your layout, then I put any javascript I write in my blade file into a stack, that gets rendered in the footer after all the other scripts.

8th October, 2018

hollyit left a reply on Hiding Vue Component From All Users Besides Owner • 6 days ago

To do it 100% in Vue you will need to pass data in from Laravel to Vue. The easiest way is to set a global variable on your page and send some json encoded data.

<script>
    var initialData = {!! json_encode($myData) !!}
</script>

Of course always make sure you've got authorization checks on your upload routes that aren't reliant upon Javascript.

1st October, 2018

hollyit left a reply on Share Classes Between Projects With Composer Does Not Work. • 2 weeks ago

@ImArtur - Symlinks is another way to go. I never had problems doing them on my Macbook, but when home and on my Windows machine, they always had a bunch of problems. I haven't tried since the Fall Creators update came out last year, which was supposed to fix those problems. Might have to give it a try again.

30th September, 2018

hollyit left a reply on Share Classes Between Projects With Composer Does Not Work. • 2 weeks ago

Your main Laravel project isn't going to know about your packages/composer.json file. By default Composer only recognizes files in the /vendor directory.

There are a couple of plugins for Composer out there that let you specify extra directories that will have the composer.json merged into your main one. Merge plugin is by far the most popular:

https://github.com/wikimedia/composer-merge-plugin

Of course if you are only using this for a couple of projects and not planning on open sourcing it, composer might be overkill. Instead I would use git submodules and do everything within in the main projects composer.json file.

29th September, 2018

hollyit left a reply on Is URL Facade Still Valid In Laravel 5.7? • 2 weeks ago

It's still in there. Sometimes you can find changes in changelog.md inside your Laravel root directory. Other times it's just searching.

If you're using a decent IDE like PHPStorm, then you get autocomplete for things like Facades, which makes life so much easier.

hollyit left a reply on Problem At Display:block; • 2 weeks ago

I noticed you got data-target on your anchor (bars). Are you using Bootstrap and Bootstrap's javascript stuff? If so then you are going to be fighting with the collapse features of Bootstrap.

26th September, 2018

hollyit left a reply on Laravel API Endpoint Pattern • 2 weeks ago

Personally I would just keep it all as /jobs/{jobid} and perform access checks in a policy (admin can update any, user only where job->user_id === Auth::user()->id)

24th September, 2018

hollyit left a reply on Vue.js DatePicker With Time • 2 weeks ago

Element has a nice one that doesn't rely on jQuery, moment or I believe any outside libraries:

https://element.eleme.io/#/en-US/component/datetime-picker

You don't have to load the entire library. You can just select which components you want.

hollyit left a reply on Unable To Find Socket Transport Starttls • 2 weeks ago

Element has a nice one that doesn't rely on jQuery, moment or I believe any outside libraries:

https://element.eleme.io/#/en-US/component/datetime-picker

You don't have to load the entire library. You can just select which components you want.

22nd September, 2018

hollyit left a reply on $ Is Not Defined - Jquery Not Found • 3 weeks ago

@tha07 - What @Cronix suggests is how to get jQuery available in the global scope (ie: attached to the global window object). When Webpack compiles, everything is within a closure as to not pollute the global namespace.

All the ProvidePlugin does is stop you from having to do an import for that module every time you want to use it. It doesn't attach the module to the global window object.

Another thing to watch out for is that if you are using several different mix.js outputs, then each one of those will have the jQuery code loaded into it. Every time you do a mix.js(...,...) you are creating a new "chunk". That chunk is going to live within its own closure. This is how Webpack prevents different Javascript files from interfering with others, such as loading one thing that requires jQuery 1.9 and something else that requires jQuery 3+. Both can be loaded, because both are within their own enclosure within the chunks.

Having said that, the way Laravel Mix counters that problem is to use Vendor extraction. That splits the vendor files out into their own file/chunk that can be accessed from any other chunks you compile. This is basically doing the Common Chunks in Webpack.

You can see this in action yourself doing a simple mix config:

mix.browserSync({
    proxy: 'cl1.devel',
    open: false
});

mix.webpackConfig({
    plugins: [new webpack.ProvidePlugin({
        $: "jquery",
    })]
});

mix
    .js('resources/js/mix1.js', 'public/js')
    .js('resources/js/mix2.js', 'public/js')

Then make mix1.js and mix2.js just something as simple as:

console.log($);

When you build them, both files will have the jQuery code inside, as the two chunks are separate from each other and don't know what is inside the other. Basically it's like 2 different webpack builds.

Now add .extract(['jquery']) to the end of your mix and build it again. Suddenly those mix1.js and mix2.js files get very small and you have a vendor.js file with jQuery in it. Webpack makes mix1 and mix2 aware of the modules available inside vendor.js.

It does take sometime to get your head around it all, but once you do you can realize how it makes sense.

hollyit left a reply on $ Is Not Defined - Jquery Not Found • 3 weeks ago

DefinePlugin just puts it in as an automatic module, exposed to other WebPack modules. Checkout the bootstrap.js file in your /resources/js and you'll see how they assign it to the window object in Laravel. You need to do that (or something similar) to make it available to non-Webpack code. The other option is using the expose-loader in Webpack.

17th September, 2018

hollyit left a reply on VUE JS Set Data From Database • 3 weeks ago

When doing remote calls, the :md-options must return a promise. So in your autoComplete try somehing like this:

autoComplete(){
    return new Promise(resolve => {
             axios.get('api/search',{params: {id: this.query}}).then(response => {
                  resolve(response.data);
             });
        });
}

15th September, 2018

hollyit left a reply on Help With Git • 4 weeks ago

One of two methods. The best and least headache (once setup) is using some sort of CI/CD system. Personally I use Gitlab for everything (self hosted).

The other option is to create a bash script on the production server that does all the magic for you (git pull, npm run production, copy environment files, do route caching and whatever else you need).

Which choice I go with depends upon client/project needs. Something that won't be updated all that often, I just do the simple bash script. For more complex projects with frequent updates then CI/CD is the way to go and saves tons of headaches in the long run.

22nd August, 2018

hollyit left a reply on How To Make An Html Tag Visible When Typing • 1 month ago

Try:

<span v-if="gross_income" v-text="'=' + gross_income"></span>

Basically the v-if will hide the span until something is in it. The v-text is a Vue directive that binds the elements textContent to whatever is in there. Since it's a directive, the value of v-text is treated as a regular expression.

14th August, 2018

hollyit left a reply on Renewing LetsEncrypt Without Forge • 2 months ago

If the original certbot configuration files are on the server, then you shouldn't have to worry about the actual CLI used to generate it. You could always try running certbot renew --dry-run and see what it's outputting. Certbot can be a pain to troubleshoot at times.

hollyit left a reply on Search Engine • 2 months ago

There's a MySQL driver for scout, which uses MySQL's full text indexing:

https://github.com/YABhq/laravel-scout-mysql-driver

One warning on shared hosting. Doing searches on a database can quickly become resource intensive. If it does that too much, then don't be surprised when you get a notice from your hosting provider about having to upgrade or find a new provider. Best thing to do is put some kind of protection on any public facing search so that people can't abuse it. Something like Captcha or throttling.

10th August, 2018

hollyit left a reply on New Session Per Subdomain! • 2 months ago

Set domain to null. If no domain is sent in the set-cookie header, then the browser will only save it for the exact domain of the document location, and exclude any subdomains. You can read about the domain portion [here]{https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie}

hollyit left a reply on QR Scanner • 2 months ago

There's Instascan, which works using WebRTC:

https://github.com/schmich/instascan

Just not that it won't work on iOS devices, since they don't support WebRTC. For those devices you'll have to get into app development, which can be pretty easily done with projects like Ionic or Cordova.

9th August, 2018

hollyit left a reply on How Do I Make The Browser Ask What A User Wants To Name A Downloaded File - With A Suggestion • 2 months ago

Newer browsers you can specify a filename in an a link .

You can view more here

Most newer browsers support it. If you need something for older browsers, then you would have to pipe the file through a download script and set a header with Content-Disposition: attachment; filename="{your file name here}"

2nd August, 2018

hollyit left a reply on Phpstorm Theme In Laracasts Series Let's Build A Forum With Laravel And TDD • 2 months ago

Almost looks like it could be the material lighter theme (part of the material theme set). I use material oceanic and switched over to the lighter one, but I've got a bunch of my own tweaks in there, but the colors appear to be the same.

29th July, 2018

hollyit left a reply on Trying To Build Rest Api Using Postman • 2 months ago

When you post a form, the HTML code that generates that form doesn't get sent to the server. It gets encoded into a query string, so your hidden example would be testing=v1.

In postman, you can do that in the raw field (field1=somedata&field2=somedata). It's the same as a URL query string, but you must make sure you URL encode everything. The easier solution is to select form-data in Postman and just fill in the field names and values. Then it takes care of that part for you.

25th July, 2018

hollyit left a reply on Do Models Have Defualt Hidden Contstructers? • 2 months ago

Eloquent models, which my guess is your User extends, do have a __constructor, which takes an array of attributes. But I'm wondering why go that route, when models already have a static create($attributes) method, which does everything you're doing there.

(HINT: builder stuff like create() is actually inside of Illuminate\Database\Eloquent\Builder and Model just passes the methods onto the builder via magic methods)

hollyit left a reply on Any “famous” Sites Built With Laravel? • 2 months ago

@Vanish not sure about now, but FedEx used to use Drupal for their newsroom.

https://dri.es/fedex-using-drupal

22nd July, 2018

hollyit left a reply on Any “famous” Sites Built With Laravel? • 2 months ago

Not sure on Laravel, but PHP runs numerous large scale sites. Just look at Wikipedia and Wordpress.com. Large parts of Facebook still run on PHP as well.

whitehouse.gov is now on Wordpress. During Obama's years it was on Drupal. Numerous US government sites still use Drupal.

When you look at Enterprise, it's more common than not to see numerous different languages and frameworks powering the various services that make up their entire online presence.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.