This repository was archived by the owner on Nov 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
Merged
Changes from 47 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
ccbf8fb
Make it possible to switch guards
jorenvanhee a592571
Use correct guard in views
jorenvanhee 2fd3f86
Fix order of use statements
jorenvanhee 08b9390
Make the admin middleware use the backpack guard
jorenvanhee feac647
Merge branch 'different-user-model-issue-fix' of git://github.com/jor…
tabacitu 87839c9
fixed lloyd's review objections in implementing custom auth guard
tabacitu 0f992ac
Auth\Login: allow username customization
kichetof 7c3593f
alert messages can now have html
tabacitu 6fe7690
added sidebar_content file; publish minimum amount of files
tabacitu 86bff8c
move dashboard sidebar item to sidebar_contents file
tabacitu d7518ec
added command that adds code to sidebar_content blade file
tabacitu df9680e
polished addSidebarContent definition and description
tabacitu aa4356a
Apply fixes from StyleCI
tabacitu 62a20a3
changelog
tabacitu 16b76a2
Merge branch 'publish-minimum-amount-of-files' of https://github.com/…
tabacitu b723665
fixes #253 - added command to add code to custom route file
tabacitu e0fdeca
Apply fixes from StyleCI
tabacitu afe6de3
fixed custom routes file namespace
tabacitu cf5d435
Merge branch 'custom-routes-file' of https://github.com/Laravel-Backp…
tabacitu 2813799
merged master and fixed conflicts:
tabacitu 37b49e1
cleaner config helper usage for guards and passwords
tabacitu 107c1f3
cleaned up admin middleware
tabacitu a5a8015
fixed logout logging out all sessions; applied custom guard to MyAcco…
tabacitu 2e1eea2
added backpack_auth helpers and removed view composers
tabacitu 83758c6
Apply fixes from StyleCI
tabacitu edb3e52
cleanup
tabacitu 5cd6190
comment method
tabacitu 353d230
added BackpackUser model and made it the default user_model_fqn
tabacitu 5b50727
Apply fixes from StyleCI
tabacitu 42d556c
Merge branch 'master' of git://github.com/kichetof/Base into kichetof…
tabacitu 9a28e97
merged PR #246, renamed variables and made necessary login view modif…
tabacitu ed41e9f
added authentication_column_name config variable
tabacitu b53c0a0
authentication_column_name should default to language email
tabacitu b9cf5c7
Apply fixes from StyleCI
tabacitu 35778df
authentication_column should default to email
tabacitu 13a9de5
Merge branch 'allow-login-with-username' of https://github.com/Larave…
tabacitu 880e770
Apply fixes from StyleCI
tabacitu f05430b
ability to customize admin middleware; fixes #67
tabacitu 4d4bd8c
Apply fixes from StyleCI
tabacitu fc3a907
renamed Admin middleware class to CheckIfAdmin
tabacitu 9d1649c
Merge branch 'custom-admin-middleware' of https://github.com/Laravel-…
tabacitu cb3b056
changed middleware to a middleware group, so that developers can incl…
tabacitu e485098
Apply fixes from StyleCI
tabacitu 06bf447
cleaned up BaseServiceProvider
tabacitu 52b895c
Merge branch 'custom-admin-middleware' of https://github.com/Laravel-…
tabacitu 459d575
Apply fixes from StyleCI
tabacitu 4ca7a19
register with username instead of email
tabacitu 3ca67c4
fixed registration, my account and password reset when using username…
tabacitu 33a9053
Merge branch 'allow-login-with-username' of https://github.com/Larave…
tabacitu 1f82ace
Apply fixes from StyleCI
tabacitu d6ebf8d
improved backpack_avatar_url helper
tabacitu 769abae
merged
tabacitu caa2cef
fixed review issues
tabacitu b153b4e
translated reset password email
tabacitu bb99618
Merge branch 'jorenvanhee-different-user-model-issue-fix' of https://…
tabacitu e6ac6e8
Apply fixes from StyleCI
tabacitu 1952f3e
Merge branch 'jorenvanhee-different-user-model-issue-fix' into upgrade
tabacitu 49e63e3
Merge branch 'upgrade' of https://github.com/Laravel-Backpack/Base in…
tabacitu 6651a22
typo
tabacitu 42a8c0a
Merge branch 'publish-minimum-amount-of-files' into upgrade
tabacitu 8822a6a
Merge remote-tracking branch 'origin/custom-routes-file' into upgrade
tabacitu 5c723cb
using helper to get backpack middleware in custom routes file
tabacitu e58ac9f
Merge branch 'html-alerts' into upgrade
tabacitu 8fe173b
added license checks
tabacitu a959ebb
Apply fixes from StyleCI
tabacitu 833091c
added stacks after sections in layout
tabacitu 7da688d
cleanup
tabacitu f110170
changelog
tabacitu 069aa50
Merge branch 'feature-stacks' into upgrade
tabacitu 71a7ee7
changelog
tabacitu 22b4427
Merge branch 'allow-login-with-username' into upgrade
tabacitu 97bd1bf
cleanup
tabacitu 6a235cb
Merge branch 'upgrade' of https://github.com/Laravel-Backpack/Base in…
tabacitu 095418e
updated js dependencies to match new adminlte paths
tabacitu e69a3d5
license check takes into acount config file variable
tabacitu 4825256
made root disk name configurable
tabacitu ce3c074
Apply fixes from StyleCI
tabacitu 03241e9
Merge branch 'master' into upgrade
tabacitu 5d68bfa
composer require updated adminlte
tabacitu 5606018
Merge branch 'upgrade' into adminlte-update
tabacitu e6e8ece
Merge branch 'custom-admin-middleware' of https://github.com/Laravel-…
tabacitu 2cbce1f
Update custom.php
tabacitu 1a04f2c
Merge pull request #264 from Laravel-Backpack/adminlte-update
tabacitu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
namespace Backpack\Base\app\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Storage; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
use Symfony\Component\Process\Process; | ||
|
||
class AddCustomRouteContent extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'backpack:base:add-custom-route | ||
{code : HTML/PHP code that registers a route. Use either single quotes or double quotes. Never both. }'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Add HTML/PHP code to the routes/backpack/custom.php file'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$path = 'routes/backpack/custom.php'; | ||
$disk = Storage::disk('root'); | ||
$code = $this->argument('code'); | ||
|
||
if ($disk->exists($path)) { | ||
$old_file_content = Storage::disk('root')->get($path); | ||
|
||
// insert the given code before the file's last line | ||
$file_lines = explode(PHP_EOL, $old_file_content); | ||
$number_of_lines = count($file_lines); | ||
$file_lines[$number_of_lines] = $file_lines[$number_of_lines - 1]; | ||
$file_lines[$number_of_lines - 1] = ' '.$code; | ||
$new_file_content = implode(PHP_EOL, $file_lines); | ||
|
||
if ($disk->put($path, $new_file_content)) { | ||
$this->info('Successfully added code to '.$path); | ||
} else { | ||
$this->error('Could not write to file: '.$path); | ||
} | ||
} else { | ||
$command = 'php artisan vendor:publish --provider="Backpack\Base\BaseServiceProvider" --tag=custom_routes'; | ||
|
||
$process = new Process($command, null, null, null, 300, null); | ||
|
||
$process->run(function ($type, $buffer) { | ||
if (Process::ERR === $type) { | ||
$this->line($buffer); | ||
} else { | ||
$this->line($buffer); | ||
} | ||
}); | ||
|
||
// executes after the command finishes | ||
if (!$process->isSuccessful()) { | ||
throw new ProcessFailedException($process); | ||
} | ||
|
||
$this->handle(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Backpack\Base\app\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Storage; | ||
|
||
class AddSidebarContent extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'backpack:base:add-sidebar-content | ||
{code : HTML/PHP code that shows the sidebar item. Use either single quotes or double quotes. Never both. }'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Add HTML/PHP code to the Backpack sidebar_content file'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$path = 'resources/views/vendor/backpack/base/inc/sidebar_content.blade.php'; | ||
$disk = Storage::disk('root'); | ||
$code = $this->argument('code'); | ||
|
||
if ($disk->exists($path)) { | ||
$contents = Storage::disk('root')->get($path); | ||
|
||
if ($disk->put($path, $contents.PHP_EOL.$code)) { | ||
$this->info('Successfully added code to sidebar_content file.'); | ||
} else { | ||
$this->error('Could not write to sidebar_content file.'); | ||
} | ||
} else { | ||
$this->error("The sidebar_content file does not exist. Make sure Backpack\Base is properly installed."); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be in a config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Totally! Done, thank you!