Skip to content

Instantly share code, notes, and snippets.

View marufsharia's full-sized avatar
🎯
Focusing

Abdullah Al Maruf marufsharia

🎯
Focusing
View GitHub Profile
@marufsharia
marufsharia / README.md
Created January 7, 2024 08:30 — forked from abelcallejo/README.md
Laravel Cheatsheet

Laravel Cheatsheet

Installation

# Prepare the working directory
cd /path/to/www
git clone git@github.com:goodyweb/example-app.git
cd /path/to/www/example-app
@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(),
@marufsharia
marufsharia / implement an alarm functionality in Flutter.md
Last active December 18, 2022 16:36
To implement an alarm functionality in Flutter, you can use the flutter_local_notifications package. This package allows you to schedule and display local notifications in Flutter.

To implement an alarm functionality in Flutter

you can use the flutter_local_notifications package. This package allows you to schedule and display local notifications in Flutter.

Here's an example of how you can use the flutter_local_notifications package to schedule an alarm in Flutter:

First, add the flutter_local_notifications package to your project's pubspec.yaml file:

dependencies:
@marufsharia
marufsharia / Tagify.php
Created October 17, 2022 17:04 — forked from localdisk/Tagify.php
Livewire Tagify Component
<?php
namespace App\Http\Livewire;
use App\Models\Tag;
use Illuminate\View\View;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\Container\BindingResolutionException;
use Livewire\Component;