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 | |
use Illuminate\Database\Seeder; | |
use Faker\Factory as Faker; | |
use App\Article; | |
class ArticlesTableSeeder extends Seeder { | |
/** | |
* Run the database seeds. | |
* |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Model Factories | |
|-------------------------------------------------------------------------- | |
| | |
| Here you may define all of your model factories. Model factories give | |
| you a convenient way to create models for testing and seeding your | |
| database. Just tell the factory how a default model should look. |
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
# Create new session directory if not already exists | |
mkdir /var/lib/php/session | |
# change mod so nginx could write in it | |
chmod -R 777 /var/lib/php/session |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /wp-content/uploads/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*) http://yourlivesite.com/wp-content/uploads/$1 [L,P] | |
</IfModule> |
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
[mysqldump] | |
user=username | |
password=password | |
## add this file in the user's directory who is going to call mysqldump. | |
## MySQLDump command will be executed without asking for username and password if this file | |
## is present with correct credentials. |
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
Reoptimized class loader: | |
php artisan optimize | |
Clear Cache facade value: | |
php artisan cache:clear | |
Clear Route cache: |
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
<VirtualHost *:80> | |
ServerName localhost | |
DocumentRoot /var/www/html | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName example.com | |
ServerAlias example.com | |
DocumentRoot /var/www/html/example.com | |
<Directory /var/www/html/example.com> |
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
// modify api base from "wp-json" to "api" | |
add_filter('json_url_prefix', 'modify_url_base' ); | |
/** | |
* Modifying Base URL from 'WP-JSON' to 'api' | |
*/ | |
function modify_url_base($prefix) { | |
return 'api'; | |
} |
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
/* | |
|-------------------------------------------------------------------------- | |
| Multi Sites Laravel Routing | |
|-------------------------------------------------------------------------- | |
| | |
| You may setup single laravel application to serve multiple applications | |
| hosting on different domains and/or subdomain using the following | |
| routing feature provided by laravel easily. Just define routes | |
| as given below. |
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 | |
// add action | |
add_action('after_setup_theme', 'gm_remove_theme_default_widgets' ); | |
/** | |
* function to check if the widgets are already removed by checking options variable | |
* | |
* If the options variable isn't already set assign empty array to `sidebars_widgets` | |
* i.e. storing active widgets |
NewerOlder