Posts

laravel with inertiajs - practice i just used for inertia projects to prevent repetitively executing inertia share method

Image
  image : https://unsplash.com/photos/TNO9gxHhhj0  Hello guys , i just thought to share my little experience in inertia js. inertia js(https://inertiajs.com/) getting quite popular with laravel now.  I had develop web project with inertia js. its easy and handle lot of Ajax tasks through the package. this helped lot  to create single page like application. but i faced issue is , there is a middlware calllded 'HandleInertiaRequests' and it have method callded 'share' . this share method calling every time we running a request through inertia service . I had created some sql query running tasks in this 'share' method, for update UI according to the updated data. things worked normally. Later I had created some ajax calling with separate routes which have their own tasks to update ui. but that not connected with inertiajs. but when I checking that ajax requests with "laravel debugbar" I saw there are lot of query executing for a little ajax call. how posb...

Laravel: Got "on behalf of" mess in email header? say No more!

Image
  If you use email service like mail gun, they default set 'sender' header part (not 'from' header) as "example.com@mailsubdomain.example.com". and  we mostly using only "from" function to set who sent the email (eg: contact@example.com) .. but some email client take this seriously . if original "example.com@mailsubdomain.example.com" is not equal to "from" that email client inform user to by showing like - "<info= example.com@mailsubdomain.example.com on behalf of contact@example.com"  this email client do for prevent misleading users. mostly this is harmless but users who don't know about this can be panic when they saw email like this . so how we fix this?? in Laravel there are two major functions in emails "from" and "sender" to set who sent the email...  "sender" is more accurate that "from" for some reasons Laravel mosly documented only "from" function. but ...

laravel-dompdf print with text watermark in every page

Image
  I stuck with a problem that is print watermark text to every page. after searching various areas of internet i found a working solution to my problem. i'm now shearing it. so it will useful to someone who have same problem first you have to install laravel-dompdf wrapper. then need to add 'PDF' word to app config aliases list(rootfolder/config/app.php) 'PDF' => Barryvdh\DomPDF\ Facade :: class , import pdf class to controller(or any kind of class object) use PDF ; create pdf wrapper object by loading blade file to laravel-dompdf $pdf = PDF :: loadView ( 'print.view' , compact ( ' yourviewdata' )); set paper size (i set L means 'letter size') $pdf -> setPaper ( 'L' ); then need to render it(we can't call dompdf render function directly. we can use output function for that comes with laravel-dompdf $pdf -> output (); now this need to get core dompdf object from laravel-dompdf wrapper to get canvas(canvas need to ad...

Create Date list bar (horizontal list) in React/React Native with moment library

Image
sometimes you may need create horizontal date list to show to user..and block required dates. i had to create date bar in my work place. so this is how i solved that using moment library . import moment from "moment"; //run function in component did mount.. setInitialDate() { const tomorrowDate = moment().add(1, 'days').format("YYYY-MM-DD"); const todayDate = moment().format("YYYY-MM-DD"); const todayName = moment().format('dddd'); //TODO: get blocked dates from backend const blockedDays =['2020-06-04','2020-06-05','2020-06-06','2020-06-07']; let dateList = []; //if need to remove weekend day you can add like this //this code part using to for set 'today' date if ((!(todayName == 'Sunday' || todayName == 'Saturday')) && moment().isBefore(moment("17:00", 'HH:mm'))) ...

host react website in firebase fast cdn hosting

Image
Firebase is a full packages for web/apps development, its by Google And the basic plan is totally free*. that plan is enough to run starting phrase of web or mobile application. hosting a static web page is very easy and simple. they have all good documentation for web hosting. but i also share how i did host my react app on Firebase.  With its ease of use and robust ecosystem, it's no wonder that developers are choosing ReactJS to build their web applications. One of the go-to platforms for hosting these applications is Google's Firebase. Firebase provides a plethora of features such as real-time databases, authentication, cloud storage, and hosting. In this blog post, I will guide you through the process of hosting your ReactJS app on Firebase, with detailed steps and console commands to ensure a seamless deployment experience. Prerequisites: 1. A ReactJS app that you want to host. 2. Node.js and npm installed on your computer. 3. A Firebase account. first test and c...

Popular posts from this blog

How to use Spatie packages to enhance your Laravel development experience

Some Briefs of Data Mining

What's New in PHP 8.2 ?