A comprehensive guide to secure your Laravel application against common attacks and vulnerabilities.
This file contains hidden or 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\Providers; | |
use Illuminate\Support\Facades\Blade; | |
use Illuminate\Support\ServiceProvider; | |
class JsTranslationsServiceProvider extends ServiceProvider | |
{ | |
public function register(): void |
This file contains hidden or 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 php:8.1-apache | |
RUN apt-get update && apt-get install -y git \ | |
libpng-dev \ | |
zlib1g-dev \ | |
libwebp-dev \ | |
libjpeg62-turbo-dev \ | |
libpng-dev libxpm-dev \ | |
libfreetype6-dev | |
RUN docker-php-ext-configure gd \ |
This file contains hidden or 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
export function decode(querystring: string): object { | |
function parseValue(value: string): any { | |
if (value === 'TRUE') return true; | |
if (value === 'FALSE') return false; | |
return isNaN(Number(value)) ? value : Number(value); | |
} | |
function dec(list: any[], isArray = false): object { | |
let obj: any = isArray ? [] : {}; |
This file contains hidden or 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
const axios = require('axios'); | |
const fs = require('fs'); | |
const process = async () => { | |
const response = await axios.get('https://goo.gl/maps/29XfoqKK5s7UdaSy8'); | |
const expression = /window.APP_INITIALIZATION_STATE=\[\[\[\d+.\d+,(\d+.\d+),(\d+.\d+)/ | |
const [,lat, long] = response.data.match(expression)[0].split('[[[')[1].split(',') | |
console.log({ lat, long}) | |
return { lat, long}; |
This file contains hidden or 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
# -----------------( Terminal ) ------------------- | |
cd /path/to/project/directory | |
sudo usermod -aG www-data $(whoami) # use 'webapp' instead of 'www-data' if you are using AWS | |
sudo chown -R $(whoami):www-data . | |
sudo find . -type f -exec chmod 0664 {} \; | |
sudo find . -type d -exec chmod 0775 {} \; | |
sudo chmod -R g+s . | |
sudo vi /etc/apache2/sites-available/example.local.conf | |
sudo a2ensite example.local.conf |
This file contains hidden or 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
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |