This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Helpers; | |
use DateTime; | |
use Illuminate\Database\Eloquent\Collection; | |
use Illuminate\Support\Facades\Crypt; | |
class General | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMPOSE_PROJECT_NAME=Cool_Project | |
DB_PASSWORD=mypassword | |
DB_DATABASE=database_name | |
DB_USERNAME=user_name | |
DB_PORT=3306 | |
DB_PORT_FORWARD=3307 | |
#for implementantion | |
WEB_PORT=80 | |
SSL_PORT=443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Reny Ramos <renyramosgarcia@gmail.com> | |
# Licence: GPL-2 | |
# Description. | |
nombre=$(cat .env | grep COMPOSE_PROJECT_NAME | cut -d "=" -f 2) | |
####################################### | |
# FUNCTIONS | |
####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Chronometer | |
{ | |
private $start = []; | |
private $end = []; | |
public function start(string $name = 'default'): void | |
{ | |
$this->start[$name] = microtime(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
{{ $meta ?? '' }} | |
<title>{{ $title }}</title> | |
@yield('style') | |
{{ $style ?? '' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Traits\ModelFileManager; | |
use Illuminate\Database\Eloquent\Model; | |
class Company extends Model | |
{ | |
use ModelFileManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch(route,{ | |
method: 'get' | |
}).then(function(response){ | |
return response.text(); | |
}).then(function(res){ | |
console.log(res) | |
}).catch(function(err){ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class CheckRole | |
{ | |
/** | |
* Handle the incoming request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
expire & throw a strange error. | |
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM phpdockerio/php73-fpm:latest | |
WORKDIR "/application" | |
# Fix debconf warnings upon build | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Install selected extensions and other stuff | |
RUN apt-get update \ | |
&& apt-get -y --no-install-recommends install php7.3-mysql \ | |
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* |
NewerOlder