Skip to content

Instantly share code, notes, and snippets.

@ercanertan
ercanertan / Laravel Module Setup.txt
Last active October 12, 2018 13:32
Laravel Module Setup
1. config/auth.php
'users' => [
'driver' => 'eloquent',
'model' => Modules\User\Entities\User::class,
],
2.Create config file for env variables
return [
@ercanertan
ercanertan / Laravel Local.txt
Last active January 31, 2018 21:39
Laravel Local
//Route
Route::group(['middleware' => ['web','locale'], 'namespace' => 'Modules\Theme\Http\Controllers'], function()
{
Route::post('changelocale', ['as' => 'changelocale', 'uses' => 'HomeController@changeLocale']);
}
@ercanertan
ercanertan / Popup_Example.blade.php
Last active December 13, 2018 12:16
Popup Example
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<h1>Sample</h1>
</div>
</div>
</div>
</div>
@ercanertan
ercanertan / mysql_export_import_for_laravel.txt
Last active October 16, 2017 13:01
Mysql Export/Import for Laravel
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
//Export
$process = new Process('mysqldump -u'.env('DB_USERNAME').' -p'.env('DB_PASSWORD').' '.env('DB_DATABASE').' > db-backups/'.Carbon::now()->timestamp.'.sql');
//Import (on production add password as well '-p'.env('DB_PASSWORD'))
$process = new Process('mysql -u'.env('DB_USERNAME').' '.env('DB_DATABASE').' '.'< db-backups/1508156934.sql');
@ercanertan
ercanertan / MAC OSX Apache-Php setup.txt
Last active October 16, 2017 12:43
Mac OSX Apache Setup
Find username
$ id
Go /etc/apache2/users/ and edit or create username.conf like below
<Directory "/Users/username/Sites/">
AddLanguage en .en
AddHandler perl-script .pl
PerlHandler ModPerl::Registry
@ercanertan
ercanertan / whm-change-document-root.md
Created July 14, 2017 10:21 — forked from Bodom78/whm-change-document-root.md
WHM/cPanel - Changing an accounts document root

To properly edit an accounts DocumentRoot go to /var/cpanel/userdata/username/ (replace username with the actual cPanel username for the account), then edit the file domain.com (where domain.com is your primary domain name).

You will see something like this in that file:

documentroot: /home/username/public_html

You will also see the cgi-bin area in this section:

scriptalias: