Skip to content

Commit

Permalink
Added seeders and migrations to keep up with Voyager changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamieljv committed Nov 3, 2021
1 parent fbcc6bc commit 2c1a6dc
Show file tree
Hide file tree
Showing 42 changed files with 1,431 additions and 90 deletions.
97 changes: 11 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,20 @@
<p align="center"><a href="https://devdojo.com/wave" target="_blank"><img src="https://cdn.devdojo.com/assets/img/github-wave-logo.svg" width="240"></a></p>
# Deployment Instructions

<p align="center"><a href="https://www.producthunt.com/posts/wave-2-0" target="_blank"><img src="https://cdn.devdojo.com/images/april2021/upvote-product-hunt-img.png" height="auto" width="auto"></a></p>
## Migrating
- Generate migrations for all tables

## Introduction
`php artisan migrate:generate`

[Wave](https://devdojo.com/wave) is a Software as a Service Starter Kit that can help you build your next great idea 💰. Wave is built with [Laravel](https://laravel.com), [Voyager](https://voyager.devdojo.com), [TailwindCSS](https://tailwindcss.com), and a few other awesome technologies. Here are some of the awesome features ✨:
- Or for one

- [Authentication](https://wave.devdojo.com/docs/features/authentication)
- [User Profiles](https://wave.devdojo.com/docs/features/user-profiles)
- [User Impersonation](https://wave.devdojo.com/docs/features/user-impersonation)
- [Subscriptions](https://wave.devdojo.com/docs/features/billing)
- [Subscription Plans](https://wave.devdojo.com/docs/features/subscription-plans)
- [User Roles](https://wave.devdojo.com/docs/features/user-roles)
- [Notifications](https://wave.devdojo.com/docs/features/notifications)
- [Announcements](https://wave.devdojo.com/docs/features/announcements)
- [Fully Functional Blog](https://wave.devdojo.com/docs/features/blog)
- [Out of the Box API](https://wave.devdojo.com/docs/features/api)
- [Voyager Admin](https://wave.devdojo.com/docs/features/admin)
- [Customizable Themes](https://wave.devdojo.com/docs/features/themes)
`php artisan migrate:generate --tables="my_table"`


## Demo
View a live [demo here](https://wave.devdojo.com), or deploy your own instance to DigitalOcean, by clicking the button below.
## Seeding
- Generate seeders

<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/thedevdojo/wave/tree/main" target="_blank"><img src="https://www.deploytodo.com/do-btn-blue.svg" width="240" alt="Deploy to DO"></a>
`php artisan iseed my_table`

- Run seeders

## Installation

To install Wave, you'll want to clone or download this repo:

```
git clone https://github.com/thedevdojo/wave.git project_name
```

Next, we can install Wave with these **4 simple steps**:

### 1. Create a New Database

During the installation we need to use a MySQL database. You will need to create a new database and save the credentials for the next step.

### 2. Copy the `.env.example` file

We need to specify our Environment variables for our application. You will see a file named `.env.example`, you will need to duplicate that file and rename it to `.env`.

Then, open up the `.env` file and update your *DB_DATABASE*, *DB_USERNAME*, and *DB_PASSWORD* in the appropriate fields. You will also want to update the *APP_URL* to the URL of your application.

```bash
APP_URL=http://wave.test

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=wave
DB_USERNAME=root
DB_PASSWORD=
```


### 3. Add Composer Dependencies

Next, we will need to install all our composer dependencies by running the following command:

```php
composer install
```
### 4. Run Migrations and Seeds

We need to migrate our database structure into our database, which we can do by running:

```php
php artisan migrate
```
<br>
Finally, we will need to seed our database with the following command:

```php
php artisan db:seed
```
<br>

🎉 And that's it! You will now be able to visit your URL and see your Wave application up and running.


## Watch, Learn, and Build

We've also got a full video series on how you can setup, build, and configure Wave. 🍿 You can watch first few videos for free, and additional videos will require a [DevDojo Pro](https://devdojo.com/pro) subscription. By subscribing to a [DevDojo Pro](https://devdojo.com/pro) subscription you will also be supporting the ongoing development of this project. It's a win win! 🙌

[Click here to watch the Wave Video Series](https://devdojo.com/course/wave).


## Documentation

Checkout the [official documentation here](https://wave.devdojo.com/docs).
`php artisan db:seed`
11 changes: 11 additions & 0 deletions app/Event.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Event extends Model
{
use HasFactory;
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
"laravel/helpers": "^1.0",
"laravel/tinker": "^2.0",
"livewire/livewire": "^2.4",
"orangehill/iseed": "^3.0",
"tcg/voyager": "1.4.x-dev",
"tymon/jwt-auth": "dev-develop"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^5.0",
"laravel/dusk": "^6.0",
"laravel/sail": "^1.4",
"mockery/mockery": "^1.3.1",
Expand Down
137 changes: 136 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions config/voyager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

'user' => [
'add_default_role_on_register' => true,
'default_role' => 'trial',
'default_role' => 'user',
'namespace' => App\User::class,
'default_avatar' => 'users/default.png',
],
Expand Down Expand Up @@ -129,14 +129,14 @@
/*
* Select default language
*/
'default' => 'en',
'default' => 'nl',

/*
* Select languages that are supported.
*/
'locales' => [
'nl',
'en',
//'pt',
],
],

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAnnouncementUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('announcement_user', function (Blueprint $table) {
$table->unsignedInteger('announcement_id')->index();
$table->unsignedBigInteger('user_id')->index();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('announcement_user');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAnnouncementsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('announcements', function (Blueprint $table) {
$table->increments('id');
$table->string('title')->default('');
$table->string('description');
$table->text('body');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('announcements');
}
}
Loading

0 comments on commit 2c1a6dc

Please sign in to comment.