Skip to content

Instantly share code, notes, and snippets.

View marufsharia's full-sized avatar
🎯
Focusing

Abdullah Al Maruf marufsharia

🎯
Focusing
View GitHub Profile
We couldn’t find that file to show.
@marufsharia
marufsharia / gist:fd6f032aa45e0e523caddc722034fafb
Last active December 22, 2025 19:22 — forked from abelcallejo/README.md
Laravel Cheatsheet
We couldn’t find that file to show.
@marufsharia
marufsharia / CreateComment.php
Created January 6, 2024 15:28 — forked from fotrino/CreateComment.php
@mentions with Alpine.js, Livewire & Tributeq
<?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\User;
class CreateComment extends Component
{
public $mentionables;
@marufsharia
marufsharia / ExportCSV.php
Created October 24, 2023 19:11 — forked from MrPunyapal/ExportCSV.php
PHP Function to Export Products as CSV (without saving it in server)
<?php
function exportCSV()
{
// Define response headers for CSV download
$headers = [
"Content-type" => "text/csv",
// Specifies the content type as CSV
"Content-Disposition" => "attachment; filename=products.csv",
// Instructs the browser to treat it as a downloadable attachment with the filename 'products.csv'
@marufsharia
marufsharia / WithAggregate.php
Created October 24, 2023 19:09 — forked from MrPunyapal/WithAggregate.php
🚀 Laravel Tip: Optimize Queries with withAggregate 📊
<?php
// In the Post model
class Post extends Model
{
public function user()
{
return $this->belongsTo(User::class);
}
}
@marufsharia
marufsharia / dio_config.dart
Created October 24, 2023 15:01 — forked from Kaival-Patel/dio_config.dart
Dio Configuration for working with api calls in flutter
import 'dart:io';
import 'package:dio/dio.dart';
class Api {
final dio = createDio();
String _token = "";
String _apiKey = "";
Api._internal();

Create a tree view component using Laravel Livewire

Here's an example of how you might create a tree view component using Laravel Livewire: First, create a new Livewire component called TreeView:

php artisan make:livewire TreeView

Next, in the TreeView.php file, define a public property to store the tree data:

@marufsharia
marufsharia / main.dart
Created December 30, 2022 06:00 — forked from eduardoflorence/main.dart
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),
@marufsharia
marufsharia / main.dart
Created December 30, 2022 05:59 — forked from eduardoflorence/main.dart
GetX - Sample GetConnect
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),