Web Developer Php, Laravel , Ci, Node
in this page i will upload about laravel tip php and node projects
https://www.fiverr.com/share/DodmA7
full stack web developer
Python Tkinter Tutorial
Tut 1
# print Hello World
from tkinter import *
root=Tk()
label1=Label(root,text="hello")
label1.pack()
root.mainloop()
https://www.youtube.com/watch?v=4d6gfdrsCs8
How to make text to speech || Text to Speech in this video we will learn how to make text to speech in JavaScript code link:https://github.com/hilalah...
Javascript
pagination in Laravel with ajax
composer require ibanapi/api;
html to pdf in php
Source Code
https://github.com/hilalahmad32/html-to-pdf.git
GitHub - hilalahmad32/html-to-pdf: this is the html to pdf in php this is the html to pdf in php. Contribute to hilalahmad32/html-to-pdf development by creating an account on GitHub.
Best way to make relation between two tabel using prisma with mongodb,mysql,postgresql,sqlite nice good amd easy
Handle ternary operators
Check variable exists before use
HTTP GET and POST Methods
Every large array work always should be with the chunk
Use a switch instead of stringing If Statements
Use of Prepared Statements for SQL injection attack
Best Way to make connection in php and mysqli
Create a class for repeated tasks
don't use require and require_once or include or include_once
laravel tip and tricks
Put this in your routes.php file and you will see the SQL that Eloquent is executing when you go to pages that have any sort of access to Eloquent models. This helps a lot when debugging SQL in Laravel.
// Display all SQL executed in Eloquent
Event::listen('illuminate.query', function($query)
{
var_dump($query);
});
Laravel package to let you manage de-normalized tables with simple configurations. Just add array based config in your models and it will automatically sync your denormalized tables. https://github.com/tkeer/flattable
// saving books in books' de-normalized tables
// and much more other options
public function getFlattableConfig(): array
{
[
[
'columns' => [
//flattable column => 'source model column'
'name' => 'name',
'published_at' => 'published_at',
'publisher_id' => 'publisher_id',
'book_id' => 'id'
],
// type of relationship b/w flattable and model
'type' => 'primary',
// how to find related entry in the flattable table
'wheres' => [
// key is flattable column
// value is column of source table (book)
'book_id' => 'id',
],
'flattable' => 'books_flattable',
]
]
}
You can use for forelse loop in your application.
Instead of doing this
($users->count())
($users as $user)
This is user {{ $user->id }}
No users found.
You may use
($users as $user)
This is user {{ $user->id }}
No users found.
For more tutorials- visit
https://www.codechief.org
If you have DB column which you want to be set only once and never updated again, you can set that restriction on Eloquent Model, with a mutator
class User extends Model
{
public function setEmailAttribute($value)
{
if ($this->email) {
return;
}
$this->attributes['email'] = $value;
}
}
What if you’re working with non-Laravel database and your timestamp columns are named differently? Maybe, you have create_time and update_time. Luckily, you can specify them in the model, too
class Notifications extends Model
{
const CREATED_AT = 'create_time';
const UPDATED_AT = 'update_time';
How to delete image from database using php and mysqli in this video i will show you how to delete image from database uisng php and mysqli ...
How to update image in php and mysqli to delete old image || PART - 4 in this video i will show you how to update data in php and mysqli Code:https://g...
source code:
https://github.com/hilalahmad32/cv-builder--in-php-and-ajax-and-jquery.git
live demo of template:
https://cv-builders.netlify.app/
Increments and decrements
If you want to increment some DB column in some table, just use increment() function. Oh, and you can increment not only by 1, but also by some number, like 50.
Post::find($post_id)->increment('view_count');
User::find($user_id)->increment('points', 50);
No timestamp columns
If your DB table doesn't contain timestamp fields created_at and updated_at, you can specify that Eloquent model wouldn't use them, with $timestamps = false property.
class Company extends Model
{
public $timestamps = false;
}
Soft-deletes: multiple restore
When using soft-deletes, you can restore multiple rows in one sentence.
Post::onlyTrashed()->where('author_id', 1)->restore();