-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:the views were created to create and edit the products using the…
… rest API.
- Loading branch information
Showing
25 changed files
with
196 additions
and
440 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 |
---|---|---|
|
@@ -19,8 +19,15 @@ public function run() | |
{ | ||
Role::truncate(); | ||
|
||
// Roles | ||
$adminRole = Role::create(['name' => 'admin']); | ||
|
||
// Permisos | ||
$permisoShowArticles = Permission::create(['name' => 'show articles']); | ||
$permisoStoreArticles = Permission::create(['name' => 'store articles']); | ||
$permisoEditArticles = Permission::create(['name' => 'edit articles']); | ||
$permisoDestroyArticles = Permission::create(['name' => 'destroy articles']); | ||
|
||
$admin = new User(); | ||
$admin->name = 'JoseM'; | ||
$admin->email = '[email protected]'; | ||
|
@@ -31,12 +38,15 @@ public function run() | |
$admin->remember_token = Str::random(10); | ||
$admin->save(); | ||
|
||
// Asignando roles | ||
$admin->assignRole($adminRole); | ||
|
||
// Asignando Permisos | ||
$adminRole->givePermissionTo($permisoShowArticles); | ||
$adminRole->givePermissionTo($permisoStoreArticles); | ||
$adminRole->givePermissionTo($permisoEditArticles); | ||
$adminRole->givePermissionTo($permisoDestroyArticles); | ||
|
||
$permiso = Permission::create(['name' => 'edit articles']); | ||
|
||
$adminRole->givePermissionTo($permiso); | ||
|
||
factory(App\User::class, 5)->create(); | ||
factory(App\User::class, 100)->create(); | ||
} | ||
} |
Oops, something went wrong.