Skip to content
Add Subscription Plans to your laravel admin project - https://github.com/bpocallaghan/laravel-admin-starter
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
database
resources/views
LICENSE
composer.json
readme.md

readme.md

Subscriptions

This will add Subscription Plans to your laravel project. Create the plan and his features for the user to register to. You can add many features and update the feature's order.

Installation

Update your project's composer.json file.

composer require bpocallaghan/subscriptions

Usage

Register the routes in the routes/vendor.php file.

  • Website
Route::resource('pricing', 'Subscriptions\Controllers\Website\SubscriptionsController');
  • Admin
Route::group(['prefix' => 'settings', 'namespace' => 'Subscriptions\Controllers\Admin'],
	function () {
		Route::resource('subscription-plans/features', 'FeaturesController');
		Route::resource('subscription-plans', 'SubscriptionPlansController');
		Route::get('subscription-plans/{subscription_plan}/features/order',
			'SubscriptionPlansController@showFeaturesOrder');
		Route::post('subscription-plans/{subscription_plan}/features/order',
			'SubscriptionPlansController@updateFeaturesOrder');
	});

Commands

php artisan subscriptions:publish

This will copy the database/seeds and database/migrations to your application. Remember to add $this->call(SubscriptionPlanFeaturesSeeder::class); $this->call(SubscriptionPlanTableSeeder::class); in the DatabaseSeeder.php

php artisan subscriptions:publish --files=all

This will copy the models, views and controllers to their respective directories. Please note when you execute the above command. You need to update your routes.

  • Website
Route::get('/pricing', 'SubscriptionsController@index');
  • Admin
Route::group(['namespace' => 'Subscriptions'], function () {
	Route::resource('subscription-plans/features', 'FeaturesController');
	Route::resource('subscription-plans', 'SubscriptionPlansController');
	Route::get('subscription-plans/{subscription_plan}/features/order',
		'SubscriptionPlansController@showFeaturesOrder');
	Route::post('subscription-plans/{subscription_plan}/features/order',
		'SubscriptionPlansController@updateFeaturesOrder');
});

Demo

Package is being used at Laravel Admin Starter project.

TODO

  • add the navigation seeder information (to create the navigation/urls)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.