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\Rules; | |
use Illuminate\Contracts\Validation\Rule; | |
/** | |
* RIB validation (valide in morocco only) | |
* | |
* @author med-ezzairi | |
* |
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
#!/bin/bash | |
# Terminate execution if any command fails | |
set -e | |
# Get tag from a script argument | |
TAG=$1 | |
GIT_REMOTE_URL='here should be a remote url of the repo' | |
BASE_DIR=/opt/demo | |
# Create folder structure for releases if necessary |
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 | |
$file = fopen( 'Countries-IT.csv', 'r' ); | |
$csv = []; | |
while ( ( $line = fgetcsv( $file ) ) !== FALSE ) { | |
$csv[] = $line; | |
} | |
fclose( $file ); | |
print_r( $csv[0] ); |
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
# Change Default php version for cli | |
sudo update-alternatives --config php | |
# Update composer to V2 | |
sudo composer self-update --2 | |
# Update composer to V1 | |
sudo composer self-update --1 |
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
// app/Services/FileService.php | |
<?php | |
namespace App\Services; | |
use Illuminate\Http\File; | |
use Illuminate\Support\Facades\Storage; | |
class FileService { | |
/** |
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\Traits; | |
use Illuminate\Support\Str; | |
use Illuminate\Database\Eloquent\Model; | |
trait HasUuid { | |
/** | |
* Get the value indicating whether the IDs are incrementing. |
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\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Console\GeneratorCommand; | |
class MakeServiceCommand extends GeneratorCommand { | |
/** | |
* The name and signature of the console command. |
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 | |
$file = fopen( 'file.csv', 'r' ); | |
$csv = []; | |
while ( ( $row = fgetcsv( $file ) ) !== FALSE ) { | |
$csv[] = array_map( function ( $value ) { | |
return preg_replace( | |
['/"/', "/\r?\n/", '/[\x00-\x1F\x80-\xFF]/'], | |
['""', '<br>', ''], | |
$value |
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
# testing env | |
.env.testing | |
# In memory sqlite db | |
DB_CONNECTION=sqlite | |
DB_DATABASE=:memory: # in memory sqlite db | |
# Look for some text | |
$this->assertSee('text'); |
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
version: '3' | |
services: | |
laravel.test: | |
build: | |
context: ./vendor/laravel/sail/runtimes/8.2 | |
dockerfile: Dockerfile | |
args: | |
WWWGROUP: '${WWWGROUP}' | |
image: sail-8.2/app | |
extra_hosts: |
OlderNewer