We all know reinventing a wheel concept and Laravel makes it so easy to where we can just plug and play with various packages. Here are some of the essential…
Sometimes you might need to add default params to axios request. I have also faced a similar situation. I thought it might help you too.
I was working on a multilingual app and need to pass the request with the selected language.
I have added @nuxtjs/axios as module. If you…
If you are trying to create a documentation site then NuxtJS is a very easy way to go. If you haven't tried NuxtJS then it wouldn’t be a problem as it is a powerful framework of VueJS making web development simple and powerful. …
I was going with some places where I needed both the with and whereHas and using that in multiple places is not a good practice. So, I tried making that a model scope and reusing wherever needed.
I have also tried to pass dynamic relation, operators, and parameters, single value where parameters or array type so in case it can handle any condition.
What I did was created a model scope like the following:
If you need this scope everywhere in the model then what you do is create a base class model and extend your model with that base class model. Then you can use it everywhere you like.
You can customize it as per your need. Hope it helps you guys.
We always try to do things faster and accidentally we add .idea directory and other unnecessary files.
I have faced this situation mostly for projects where there is no .gitignore generated automatically. Later on, when I try to check the repo from another machine or my team members see it then I feel like Oh! not again!
Here is the code to remove any files if you want to remove it from your git repository.
echo '.idea' >> .gitignore
git rm -r --cached .idea
git add .gitignore
git commit -m 'removed .idea'
If you want to remove any other files or dir then follow the steps like above.
Example: Removing a file name .DS_Store in Mac:
echo '.DS_Store' >> .gitignore
git rm -r --cached .DS_Store
git add .gitignore
git commit -m 'removed .DS_Store'
Hope it helps you!
Before I start here, I was working with objects and arrays in PHP and other languages. I have been using VueJS these days and always get confused about where to use array or object or convert the object to an array or convert array to object. …
If you ever encounter an issue with the incompatible plugin and have installed the plugin in PhpStorm, WebStorm, or any other JetBrains IDE. What I also faced was; I installed a plugin in PhpStorm and that plugin was not compatible with the newer version of PhpStorm.
If you are planning to move to laravel from any other framework or if your just starting your php framwork on Laravel then installing laravel may get confusing. I have heard about many developers and newbies having this issue for the first time jumping into laravel. The documentation says it…
WordPress Pagination is a very essential part for the front, category or archive pages, so you will require you hands on skill on pagination, but it is not as easy as it seems and the documentation for the pagination is not that straightforward if you want page numbers.