Skip to content

Instantly share code, notes, and snippets.

View phpfact's full-sized avatar
🎯
Focusing

Sachin Sharma phpfact

🎯
Focusing
View GitHub Profile
@phpfact
phpfact / index.js
Last active October 28, 2020 17:18
/* src/index.js */
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Welcome Sachin Sir</h1>,
document.getElementById('root')
);
@phpfact
phpfact / index.php
Last active November 6, 2020 15:33
<?php
public function page_list(){
$collection = DB::table('pages as p')->select('p.id','p.slug','p.post_date','p.status','p.feature_image','c.title as category_title')
->leftjoin('categories as c','p.category_id', 'c.id')->orderBy('id', 'desc')->get();
return view('dashboard.pages.page', compact('collection'));
}
//->orderBy('id', 'desc') // Last record show first
//->orderBy('id', 'asc') // First record show first
return \URL::current();
return \Request::url();
return \Request::fullUrl();
$url_segment = \Request::segment(3);
/* comma separated query builder comma separated string in laravel laravel comma seprated find find_in_set */
$data = \DB::table("myposts")
->select("myposts.*")
->whereRaw("find_in_set('".$search."',myposts.tags)")
->get();
/* OR */
What is CURL
how to download file with curl
how to call api with curl
What is CURD
@phpfact
phpfact / list.txt
Last active November 3, 2023 04:37
/* Basic Question You Shoud Know, Basic Developer Question, Basic Knowladge for developer student basic knowladge */
Sure, here's a list of 30 basic questions you can ask a PHP developer with 1 to 3 years of experience:
1. How many projects have you completed as a PHP developer?
2. Have you hosted any websites on a hosting server? If yes, please provide examples.
3. Have you set up SSL certificates for websites? If yes, please explain the process.
4. Which PHP frameworks are you familiar with? (e.g., Laravel, CodeIgniter, CakePHP, or only Core PHP/OOP PHP)
5. Have you integrated SMTP, SMS Gateway, or Payment Gateway services into any projects? If yes, please provide details.
6. Can you explain the basic operations of Insert, Update, Delete, and Fetch in SQL?
Kbhi Kbhi Image Cache me hli jati hai. or fir image ka size yaa image compress kr k replace krne pr bhi webpage pr image replace nhi hoti. too image ka name change krna pdta hai. image ka name image modification k acording change hote rhe too php 1 function aata hai.
/* Source : https://stackoverflow.com/questions/321865/how-to-clear-or-replace-a-cached-image */
<?php
$addthis = filemtime('myimf.jpg');
?>
<img src="myimg.jpg?"<?= $addthis;?> >
/* Hidden files display */
ls -a
/* Hidden files display */
ls -al
root@mail:/var/www/oneclickvisas/oneclickvisas_new# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Warning from https://packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/ui v3.0.0 requires php ^7.3 -> your PHP version (7.2.24) does not satisfy that requirement.
- laravel/ui 3.x-dev requires php ^7.3|^8.0 -> your PHP version (7.2.24) does not satisfy that requirement.