Skip to content

Instantly share code, notes, and snippets.

View ribafs's full-sized avatar
❤️
Estudando e Trabalhando

Ribamar FS ribafs

❤️
Estudando e Trabalhando
View GitHub Profile

How to Deploy laravel Applications on Heroku.

Heroku-Laravel

Introduction

Welcome to a series of Deploying a Laravel Application.

Laravel applications are deployed on many sites.

I will be taking you through on how to deploy a laravel application which has a database and to be specific, Postgresql Database.

@ribafs
ribafs / DatabaseUtils.php
Created February 14, 2022 14:45 — forked from bencentra/DatabaseUtils.php
Revised version of db_utils.php, refactored as a PHP class.
<?php
/*
* DatabaseUtils.php - A class of simple database utilities.
*
* Performs CRUD operations using PDO (MySQL) prepared statements.
*
* Author: bencentra (https://gist.github.com/bencentra/92228e1f4139436c4153)
*/
@ribafs
ribafs / database.class.php
Created February 11, 2022 19:58 — forked from ftonato/database.class.php
PDO Connection Class using Singleton
<?php
/**
* PDO Singleton Class v.1.0
*
* @author Ademílson F. Tonato
* @link https://twitter.com/ftonato
*
*/
class DB {
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Título</title>
<style>
footer {
text-align:center;
@ribafs
ribafs / List.md
Created December 20, 2021 22:00 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@ribafs
ribafs / FixtureTestCase.php
Created December 19, 2021 19:04 — forked from jeremyharris/FixtureTestCase.php
Full code for: http://someguyjeremy.com/blog/database-testing-with-phpunit Place fixtures in a `fixture` folder.
<?php
// we're loading the Database TestCase here
require 'PHPUnit' . DIRECTORY_SEPARATOR . 'Extensions' .
DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR .
'TestCase.php';
class FixtureTestCase extends PHPUnit_Extensions_Database_TestCase {
public $fixtures = array(
'posts',
<?php
class Pai
{
protected $name = 'João Brito';
}
class Filho extends Pai
{
// A propriedade protected na classe pai pode ser acessada pela classe filha
// Mas não pode ser acessada diretamente por um objeto da classe filha
@ribafs
ribafs / pdo_db.php
Created December 15, 2021 15:00 — forked from bradtraversy/pdo_db.php
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;
@ribafs
ribafs / unit-testing-model-using-dbunit-extension.md
Created December 13, 2021 14:59 — forked from umidjons/unit-testing-model-using-dbunit-extension.md
Unit testing model using DBUnit PHPUnit extension

Unit testing model using DBUnit PHPUnit extension

I assume, that you already have phpunit installed and added into PATH. Create guestbook database in mysql. Create guestbook table in that database.

Create model to test

File src\Guestbook.php

<?php
@ribafs
ribafs / rant.md
Created December 10, 2021 21:49 — forked from DaveRandom/rant.md
Why you should not use relative paths when working with files in PHP

TL;DR do what the last section tells you to do

What is the difference between a relative path and an absolute path?

An absolute path is one which includes all path components from the root of the file system. It starts with a leading / on unix-like operating systems, or a drive letter on Windows.

Unix: /full/path/to/file.php

Windows C:\full\path\to\file.php