How to get all rows (soft deleted too) from a table in Laravel?
To get all rows from a table, I have to use Model::all() but (from good reason) this doesn't gives me back the soft deleted rows. Is there a way I can accomplish this with Eloquent?
View ArticleAnswer by totymedli for Fill Chart.js bar chart with diagonal stripes or...
tl;drJust pass a CanvasPattern or CanvasGradient to the dataset's backgroundColor property as the official docs say.Excuse me, what?This can be done through a 3rd party library like patternomaly, but...
View ArticleAnswer by totymedli for "Error: You may not call store.getState() while the...
tl;drMake sure you don't have any code that causes side effects in your reducers!Pure reducersRedux reducers need to be pure. This means they shouldn't have side effects. Side effects should go to...
View ArticleAnswer by totymedli for Openstreetmap: embedding map in webpage (like Google...
Simple OSM Slippy Map Demo/ExampleClick on "Run code snippet" to see an embedded OpenStreetMap slippy map with a marker on it. This was created with Leaflet.Code// Where you want to render the map.var...
View ArticleAnswer by totymedli for Module not found: Error: Can't resolve 'fs' error
tl;drFor people transpiling for Node.js: add target: node to the webpack.config.js file.ExplanationI know this is an Angular question but those who are transpiling for Node.js have to keep in mind that...
View ArticleAnswer by totymedli for Electron+Webpack = Module not found: Error: Can't...
tl;drTell Webpack to ignore that require via IgnorePlugin:const { IgnorePlugin } = require('webpack');const optionalPlugins = [];if (process.platform !== "darwin") { // don't ignore on OSX...
View ArticleAnswer by totymedli for JSON to XML Using Javascript
Object/Array to XML converterThe following solution can turn a JS variable to a (non indented) XML string. It supports both lists (arrays) and objects.Use objectToXml(object) to create a valid XML with...
View ArticleHow to make a QPushButton pressable for enter key?
I want to make my app laptop friendly. I can tab to everywhere, but if I tab to a QPushButton I can't press it with Enter, only with space.What's the problem? How to make it pressable for Enter?
View ArticleReturn values only (no keys/associative array) in Laravel
SituationI have the following code to get all data as an array:Data::select('id', 'text')->get()->toArray();This will return the data in the following format:array:1 [ 0 => array:2 ["id" =>...
View ArticleHow to log unicode characters to the console in JavaScript?
I have a Hungarian statement that I would like to log to the console like this:console.log('Probléma a működésben.');But it prints the following:> Probléma a működésben.The non ASCII characters...
View ArticleAnswer by totymedli for How to add "Ubuntu Font Family" to my site using CSS?
Importing the fontFirst, you have to make sure, your site has that font in case the average user who visits your site doesn't have it.Option 1 - Import from external providerYou can import the whole...
View ArticleAnswer by totymedli for How to exclude folder from "Explore" tab?
GUI wayGo to "File -> Preferences -> Settings" (or press Ctrl+,) then:Type "exclude" to the search bar.Select the "Workspace" tab if you want this change to only effect your current project...
View ArticleAnswer by totymedli for Request::has() returns false even when parameter is...
tl;drUpgrade to Laravel 5.5 or higher. They changed this so now it works as you originally expected.ExplanationIn the Laravel 5.5 upgrade guide, we read the following:The has MethodThe...
View ArticleAnswer by totymedli for Keyboard shortcut to jump to the end of the command...
As this answer pointed out you can use Meta+< and Meta+>.Usually the Meta key is mapped to the Alt or Alt+Shift keys. The < and > keys varies a lot depending on the keyboard and the layout...
View ArticleAnswer by totymedli for webpack imported module is not a constructor
tl;drMake sure that you import properly through index files.ExplanationFor me, this error was caused by importing through index files. I had multiple directories with their index.ts files that exported...
View ArticleAnswer by totymedli for How to rename .env variables in package.json?
tl;drIf the package you try to configure has the ability to do configuration via a JavaScript file, you can add the renaming at the beginning of it:process.env.PERCY_TOKEN =...
View ArticleHow to rename .env variables in package.json?
What I haveI have multiple projects using Percy for Cypress where I set the PERCY_TOKEN env variable inside the .env file. The token is different for each project. In the CI I set different env...
View ArticlePHP Fatal error: Cannot use positional argument after argument unpacking
GoalI would like to write a function with variable number of parameters (using ...) that calls another function with the same arguments and a new one at the end. Order is important! The example below...
View ArticleAnswer by totymedli for PHP Fatal error: Cannot use positional argument after...
tl;drUnpacking after arguments is not allowed by design, but there are 3 workarounds:Create an array from the new element and unpack that as Paul suggested: function foo(...$params) { $extraVariable =...
View ArticleLaravel's Artisan says nothing to migrate
I installed migrations with php artisan migrate:install then created a migration with the php artisan migrate:make create_teams_table command. Now I try to run them with the following command that I...
View Article