Hunter Education Moves Online: First-Time Hunters, Get Started Now

Hunter Education Moves Online: First-Time Hunters, Get Started Now

https://ift.tt/336qqIB

With COVID restrictions redefining public spaces across the country, most states have moved hunter education to an online model. And some are offering free tuition.

New hunters in the United States must pass a hunter education course before buying a license for the first time. Before the pandemic, most hunter ed courses consisted of an in-class learning structure or an online learning requirement, coupled with an instructed field day component complete with the final test. Certifications mandated the completion of the in-person field component to complete the course.

But, with pandemic restrictions, a different kind of safety is being considered. Because of this, state agencies are modifying their hunter and bowhunter education structures to better accommodate new hunters.

States Waive Fees, Create Virtual Field Days

In an effort to make hunter ed more accessible, states are getting creative. States like WashingtonWisconsin, and Florida have moved their instructor field day to a virtual classroom, where volunteer instructors or virtual instructors lead students through the information typically studied.

Other states are moving to an online-only course with testing, and Montana is offering both hunter and bowhunter educational courses online for free. This is restricted to Montana residents. And these courses will still have reciprocity across the U.S. for out-of-state hunting.

Online Option Opens Up Access for New Hunters

The bright side of online hunter education options means that more folks are likely to take the course on their own time. And the majority of hunter ed courses are already affordable, ranging from $10 to $30 per hunter.

It’s a smart idea to go ahead and get the bowhunter certification — whether your state requires it or not — while it’s easily accessible online. Some states require a bowhunting certification, others don’t. But taking it now will ensure your ability to archery hunt nationwide for the foreseeable future.

Find your state’s requirements by going to their wildlife agency’s hunter education page. Companies like Hunter-Ed and the NRA offer online courses, but each state is responding to the current pandemic differently. Some, like Utah, are still requiring small in-person courses for some hunter demographics.

The post Hunter Education Moves Online: First-Time Hunters, Get Started Now appeared first on GearJunkie.

Outdoors

via GearJunkie https://gearjunkie.com

July 29, 2020 at 04:51PM

E-commerce Laravel – Demo Laravel 7 Application

E-commerce Laravel – Demo Laravel 7 Application

https://ift.tt/3hJxnTT


In simple words, e-commerce is buying and selling of goods through internet means. There has been vast development in e-commerce since its introduction in the market. Buying and selling of goods has been a lot easier because of it.

E-commerce laravel was developed using latest Laravel 7. This project is simple yet very educational. It uses MVC as it’s base architecture for development. As a result, it’s coding architecture is clean and simple to understand.

It has almost every important features that a good ecommerce website should have. Some of those features are here below:

  • Users can view all added products according to categories
  • It also has add to cart and checkout feature
  • Users can also saved items for later
  • Online payment system using Stripe

Some snapshots of this website is here below:


Checkout Page


Cart Items Page


Product Page

Steps for installation:

git clone https://github.com/SanishGrg/Laravel7-ecommerce.git Laravel7-ecommerce
cd Laravel7-ecommerce
cp .env.example .env
composer install
php artisan key:generate
php artisan migrate

// if you want dummy data and users to get generated
php artisan db:seed

As the program is still in beta stage be sure to get update for new features. 😉

programming

via Laravel News Links https://ift.tt/2dvygAJ

July 28, 2020 at 01:27PM

How to make a Laravel app multi-tenant in minutes

How to make a Laravel app multi-tenant in minutes

https://ift.tt/2WXLayc


In this tutorial, we’ll make your Laravel app multi-tenant using the Tenancy for Laravel package.

It’s a multi-tenancy package that lets you turn any Laravel application multi-tenant without having to rewrite the code. It’s as plug-and-play as tenancy packages get.

Side note: In this tutorial, we’ll go over the most common setup — multi-database tenancy on multiple domains. If you need a different setup, it’s 100% possible. Just see the package’s docs.

How it works

This package is unique in the sense that it doesn’t force you to write your application in a specific way. You can write your app just like you’re used to, and it will make it multi-tenant automatically, in the background. You can even integrate the package into an existing application.

Here’s how it works:

  1. A request comes in
  2. The package recognizes the tenant from the request (using domain, subdomain, path, header, query string, etc)
  3. The package switches the default database connection to the tenant’s connection
  4. Any database calls, cache calls, queued jobs, etc will automatically be scoped to the current tenant.

Installation

First, we require the package using composer:

composer require stancl/tenancy

Then, we run the tenancy:install command:

php artisan tenancy:install

This will create a few files: migrations, config file, route file and a service provider.

Let’s run the migrations:

php artisan migrate

Register the service provider in config/app.php. Make sure it’s on the same position as in the code snippet below:

/*
 * Application Service Providers...
 */
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\TenancyServiceProvider::class, // <-- here

Now we create a custom tenant model. The package is un-opinionated, so to use separate databases and domains, we need to create a slightly customized tenant model. Create a app/Tenant.php file with this code:

<?php

namespace App;

use Stancl\Tenancy\Database\Models\Tenant as BaseTenant;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Concerns\HasDatabase;
use Stancl\Tenancy\Database\Concerns\HasDomains;

class Tenant extends BaseTenant implements TenantWithDatabase
{
    use HasDatabase, HasDomains;
}

And now we tell the package to use that model for tenants:

// config/tenancy.php file

'tenant_model' => \App\Tenant::class,

The two parts

The package sees your app as two separate parts:

  • the central app — which hosts the landing page, maybe a central dashboard to manage tenants etc
  • the tenant app — which is the part that your users (tenants) use. This is likely where most of the business logic will live

Separating the apps

Now that we understand the two parts, let’s separate our application accordingly.

Central app

First, let’s make sure the central app is only accessible on central domains.

Go to app/Providers/RouteServiceProvider.php and make sure your web and api routes are only loaded on the central domains:

protected function mapWebRoutes()
{
    foreach ($this->centralDomains() as $domain) {
        Route::middleware('web')
            ->domain($domain)
            ->namespace($this->namespace)
            ->group(base_path('routes/web.php'));
    }
}

protected function mapApiRoutes()
{
    foreach ($this->centralDomains() as $domain) {
        Route::prefix('api')
            ->domain($domain)
            ->middleware('api')
            ->namespace($this->namespace)
            ->group(base_path('routes/api.php'));
    }
}

protected function centralDomains(): array
{
    return config('tenancy.central_domains');
}

Now go to your config/tenancy.php file and actually add the central domains.

I’m using Valet, so for me the central domain is saas.test and tenant domains are for example foo.saas.test and bar.saas.test.

So let’s set the central_domains key:

'central_domains' => [
    'saas.test', // Add the ones that you use. I use this one with Laravel Valet.
],

Tenant app

Now, the fun part. This part is almost too simple.

To make some code tenant-aware, all you need to do is:

  • move the migrations to the tenant/ directory
  • move the routes to the tenant.php route file

That’s it.

Having migrations in that specific folder tells the package to run those migrations when a tenant is created. And having routes in that specific route file tells the package to identify tenants on that route.

If you have an existing app, do this with your code. If you’re using a fresh app, follow this example:

Your tenant routes will look like this by default:

Route::middleware([
    'web',
    InitializeTenancyByDomain::class,
    PreventAccessFromCentralDomains::class,
])->group(function () {
    Route::get('/', function () {
        return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
    });
});

These routes will only be accessible on tenant (non-central) domains — the PreventAccessFromCentralDomains middleware enforces that.

Let’s make a small change to dump all the users in the database, so that we can actually see multi-tenancy working. Add this to the middleware group:

Route::get('/', function () {
    dd(\App\User::all());
    return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
});

And now, the migrations. Simply move migrations related to the tenant app to the database/migrations/tenant directory.

So, for our example: To have users in tenant databases, let’s move the users table migration to database/migrations/tenant. This will prevent the table from being created in the central database, and it will be instead created in the tenant database when a tenant is created.

Trying it out

And now let’s create some tenants.

We don’t yet have a landing page where tenants can sign up, but we can create them in tinker!

So let’s open php artisan tinker and create some tenants. Tenants are really just models, so you create them like any other Eloquent models.

Note that we’re using domain identification here. So make sure the domains you use will point to your app. I’m using Valet, so I’m using *.saas.test for tenants. If you use php artisan serve, you can use foo.localhost, for example.

    >> $tenant1 = Tenant::create(['id' => 'foo']);
    >> $tenant1->domains()->create(['domain' => 'foo.saas.test']);
>>>
    >> $tenant2 = Tenant::create(['id' => 'bar']);
    >> $tenant2->domains()->create(['domain' => 'bar.saas.test']);

And now we’ll create a user inside of each tenant’s database:

App\Tenant::all()->runForEach(function () {
    factory(App\User::class)->create();
});

And that’s it — we have a multi-tenant app!

If you visit foo.saas.test (or your environment’s equivalent), you will see a dump of users.

If you visit bar.saas.test, you will see a dump of different users. The databases are 100% separated, and the code we use — App\User::all() — does not need to know about tenancy at all! It all happens automatically in the background. You just write your app like you’re used to, without having to think of any scoping yourself, and it all just works.

Now, of course, you will have a more complex app inside the tenant application. A SaaS that simply dumps users wouldn’t probably be of much use. So that’s your job — write the business logic that will be used by your tenants. The package will take care of the rest.

The Tenancy for Laravel project’s help doesn’t end there though. The package will do all the heavy lifting related to multi-tenancy for you. But if you’re building a SaaS, you will still need to write billing logic, an onboarding flow, and similar standard things yourself. If you’re interested, the project also offers a premium product: the multi-tenant SaaS boilerplate. It’s meant to save you time by giving you the SaaS features you’d normally have to write yourself. All packed in a ready to be deployed multi-tenant app. You may read more about it here.

Final note: This tutorial is meant to show you how simple it is to create a multi-tenant app. For your reading comfort, it’s kept short. For more details, read the package’s quickstart tutorial or the documentation.

Good luck with your SaaS!

Filed in:
News

programming

via Laravel News https://ift.tt/14pzU0d

July 27, 2020 at 09:02AM

Jet Engine Camper

Jet Engine Camper

https://ift.tt/2OUQxKp

Jet Engine Camper

Link

Builder Steve Jones got his hands on the jet engine nacelle from an old Royal Air Force VC10 airplane, and has since transformed the circular housing into a truly unique camper. It can sleep four in its cozy living space, which can transform into a dining room. Check out the full build history on the project’s Facebook page.

fun

via The Awesomer https://theawesomer.com

July 26, 2020 at 02:01PM

Kevin James: Gone Fishin’

Kevin James: Gone Fishin’

https://ift.tt/3f65RP3

Kevin James: Gone Fishin’

Link

“You want Earth? You can just take it.” After a fisherman is abducted by aliens, he explains to his captors how screwed up our planet is and how it’s not really worth their effort. Kevin James‘ short film offers a comedic but occasionally profound look at humans can be simultaneously the worst and the best things ever.

fun

via The Awesomer https://theawesomer.com

July 24, 2020 at 06:00PM

ATM vs. Hand Grenade

ATM vs. Hand Grenade

https://ift.tt/3eTGlfD

ATM vs. Hand Grenade

Link

Opening up an ATM with a hand grenade seems like a bad idea, but we suppose if you own the machine, you can do whatever you want with it, right? Edwin Sarkissian decided to see what would happen when he tossed an M67 frag grenade into one of those convenience store ATMs, and the carnage is everything you could hoped for.

fun

via The Awesomer https://theawesomer.com

July 22, 2020 at 12:30PM

Vemto – Upcoming Laravel Code Generator and Studio

Vemto – Upcoming Laravel Code Generator and Studio

https://vemto.app


Settings for Code Generation

You can control a lot of code generation settings, for example: use Fillable or Guarded strategy for mass assignment, change the default Auth. Model, change the folder and namespace to generate the Models, the Controllers, the CSS Framework, etc

programming

via Laravel News Links https://ift.tt/2dvygAJ

July 22, 2020 at 03:21PM

Getting Started With Default Sorting In Your Eloquent Models

Getting Started With Default Sorting In Your Eloquent Models

https://ift.tt/32M7LBI


Default Model Sorting package is a mini Laravel package I published recently. By default, Laravel Eloquent models return queries that are ordered by the id column of the model table.

With this package, you can set default order by in your Eloquent model so you don’t have to call the orderBy Eloquent builder.

<?php

Article::orderBy('title', 'asc')->get(); 


Article::all(); 

Installation

First you have to install this package via composer.

composer require stephenjude/default-model-sorting

Usage

Using the DefaultOrderBy trait of this package, you can set the default column you want to sort by.

For example, if you want to set the default order column for Article model (assuming you are building a blog). You will use the DefaultOrderBy trait and set the $orderByColumn property inside your Article model.

use Stephenjude/DefaultModelSorting/Traits/DefaultOrderBy;

class Article extends Model
{
    use DefaultOrderBy;

    protected static $orderByColumn = 'title';
}

Now your Article model queries will be ordered by title column in ascending order.

You can also set the $orderByColumnDirection property. This property is set to asc as the default value.

protected static $orderByColumnDirection = 'asc';

To set the global default $orderByColumnDirection property, publish the package configuration file.

php artisan vendor:publish --provider="Stephenjude\DefaultModelSorting\DefaultModelSortingServiceProvider" --tag="config"

Now you can update the configuration file as you desire.

return [    
    
    'order_by' => 'asc',
];

Under The Hood

This package is has a trait DefaultOrderBy that adds a default_order_by global scope to the boot() method of your Eloquent model.

 <?php
 ...
 protected static function boot()
 {
     parent::boot();

     
     $column = Self::$orderByColumn;

     
     $direction = isset(Self::$orderByColumnDirection)
            ? Self::$orderByColumnDirection
            : config('default-model-sorting.order_by');
     
     
     static::addGlobalScope('default_order_by', function (Builder $builder) use ($column, $direction) {
            $builder->orderBy($column, $direction);
        });
} 

If you don’t want to use the package, you can add this code to your Eloquent model.

If you find this package helpful please give it a start on Github.

programming

via Laravel News Links https://ift.tt/2dvygAJ

July 22, 2020 at 03:21PM

Mercury Tactical Messenger Bag

Mercury Tactical Messenger Bag

https://ift.tt/32ExxYD

Mercury Tactical Messenger Bag

 | Buy

Carry your computer and organize your everyday work essentials in this military-style messenger bag from Mercury Tactical Gear. Its main compartment is padded, and includes a removable laptop case with its own handle, while its exterior features MOLLE webbing and three detachable accessory pouches.

fun

via The Awesomer https://theawesomer.com

July 21, 2020 at 10:15AM