Skip to content

a junior dev blog, on PHP and Laravel

  • Home
a junior dev blog, on PHP and Laravel

Working with Pivot Tables in Many to Many Relationships in Laravel

Byphpjunior July 12, 2023July 12, 2023

consider a Many-to-Many relationship: a book can have many authors and every author can have many books. so the table structure is something like this. books: authors: book_author: and the models: the book_author table is called a pivot table which stores the ids of authors and books related to each…

Read More Working with Pivot Tables in Many to Many Relationships in LaravelContinue

how to use tagify js with laravel livewire

Byphpjunior July 10, 2023July 10, 2023

We are going to build a Livewire component using tagify library. tagify is a javascript library with a lot of features to make a tag input like this: the goal is to create a livewire component to interact with this library. Install Livewire First, install Livewrie in your Laravel project…

Read More how to use tagify js with laravel livewireContinue

Create an Admin Panel with Filamentphp

Byphpjunior July 3, 2023July 3, 2023

In this tutorial, we are going to create a CRUD operation in a Laravel project with Filament admin panel. Filament is a library that uses TALL stack to create a beautiful admin panel very fast. with the help of this library, we are able to do some tasks in minutes…

Read More Create an Admin Panel with FilamentphpContinue

filamentphp admin route not found

Byphpjunior June 27, 2023September 29, 2023

if you just installed Filamentphp admin panel and “/admin” gives you a 404 error try clearing route cache.

Read More filamentphp admin route not foundContinue

downoad image using php and GuzzleHttp

Byphpjunior June 26, 2023July 16, 2023

In php we can use Guzzle library to download images. Here I am using books.toscrape.com website as an example. First, we have to install Guzzle library. and then include “autoload.php” file. we need the “src” of the images we want to scrape. use inspect element to find the address. then…

Read More downoad image using php and GuzzleHttpContinue

How to use json_encode and json_decode in php

Byphpjunior June 25, 2023June 25, 2023

json_encode and json_decode are php functions for working with JSON strings. Converting Array to JSON json_encode takes an array as a parameter and converts it to JSON. let’s test it. here it returns this JSON string: we can pass a second parameter as a flag to json_encode function. these flags…

Read More How to use json_encode and json_decode in phpContinue

change php version of phpstorm terminal

Byphpjunior June 23, 2023June 23, 2023

changing php version in local web server doesn’t change the version in the command line terminal of an IDE like PhpStorm. here I changed the php version in laragon but the version in phpstorm terminal stays the same. you can check it with php -v command to change that we…

Read More change php version of phpstorm terminalContinue

using try catch in laravel

Byphpjunior June 21, 2023June 21, 2023

it’s important for a software to be able to handle errors effectively. it has to log the error and inform the user so he knows what’s the issue and decide what to do next. in develpoing with laravel try-catch statement help us achieve this. it checks if the code give…

Read More using try catch in laravelContinue

How to Set the Laravel Checkbox Component as Checked

Byphpjunior June 20, 2023June 20, 2023

using components in Laravel helps us keep the UI code clean and reusable in other places. imagine we have a component we created for a checkbox: we use it in a blade file like this: we should be able to check or uncheck the checkbox based on some value in…

Read More How to Set the Laravel Checkbox Component as CheckedContinue

Order Database queries by Relationship in Laravel

Byphpjunior June 18, 2023June 18, 2023

sometimes we need to order the records of a table based on a column from another table. imagine we have a table called “authors” that has a relationship with a “books” table. we might need to get books and sort them based on author’s name. here I will explain ordering…

Read More Order Database queries by Relationship in LaravelContinue

Page navigation

Previous PagePrevious 1 2 3 Next PageNext

© 2026 a junior dev blog, on PHP and Laravel

Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}
  • Home