Skip to content

Instantly share code, notes, and snippets.

View habibtalib's full-sized avatar

Habib Talib habibtalib

View GitHub Profile
@habibtalib
habibtalib / CreateMediaRecord.php
Created October 17, 2023 12:20 — forked from monoman81/CreateMediaRecord.php
Filament Relation Managers and Spatie Media Library
<?php
namespace App\Filament\Resources\Admin\ProductResource\RelationManagers;
use Filament\Resources\RelationManager\CreateRecord;
class CreateMediaRecord extends CreateRecord
{
public function getMediaRealPath()
@habibtalib
habibtalib / Brand.php
Created October 17, 2023 12:20 — forked from monoman81/Brand.php
Using Filament with Spatie Media Library
//Model Brand.php.
<?php
namespace App\Models\Admin;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Spatie\MediaLibrary\HasMedia;
@habibtalib
habibtalib / README.md
Created November 29, 2022 09:33 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@habibtalib
habibtalib / laravel_valet_setup.md
Created September 12, 2022 02:21 — forked from bradtraversy/laravel_valet_setup.md
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Export ERD (diagrams) from SequelPro

Install graphviz

sudo brew install graphviz

Open SequelPro, choose database and export dot file. Now, run the command:

@habibtalib
habibtalib / PushNotifications.php
Created August 1, 2021 13:38 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@habibtalib
habibtalib / OpenCartValetDriver.php
Created June 24, 2021 15:39 — forked from veganista/OpenCartValetDriver.php
Laravel Valet Driver - OpenCart 2.x
<?php
class OpenCartValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@habibtalib
habibtalib / MySQL_5-7_macOS.md
Created May 6, 2021 15:42 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@habibtalib
habibtalib / GoogleDriveServiceProvider.php
Created March 16, 2021 14:25 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@habibtalib
habibtalib / LoginController.php
Created June 25, 2020 10:31 — forked from yugo412/LoginController.php
Redirect to custom URL after logout on Laravel
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller