Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
El-Captain Sports Management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
El-Captain Sports Management
Commits
e903c1d9
Commit
e903c1d9
authored
Jul 22, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix permissions migration — match actual table schema (no guard_name)
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
3c335666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
2026_07_22_000003_add_expense_permissions.php
.../migrations/2026_07_22_000003_add_expense_permissions.php
+28
-16
No files found.
database/migrations/2026_07_22_000003_add_expense_permissions.php
View file @
e903c1d9
...
...
@@ -7,32 +7,44 @@
{
public
function
up
()
:
void
{
$permissions
=
[
'expenses.create'
,
'expenses.list'
,
'expenses.view'
];
$permissions
=
[
[
'name'
=>
'expenses.create'
,
'module'
=>
'expenses'
,
'action'
=>
'create'
],
[
'name'
=>
'expenses.list'
,
'module'
=>
'expenses'
,
'action'
=>
'list'
],
[
'name'
=>
'expenses.view'
,
'module'
=>
'expenses'
,
'action'
=>
'view'
],
];
foreach
(
$permissions
as
$perm
)
{
DB
::
table
(
'permissions'
)
->
insertOrIgnore
([
'name'
=>
$perm
,
'guard_name'
=>
'web'
,
'name'
=>
$perm
[
'name'
],
'module'
=>
$perm
[
'module'
],
'action'
=>
$perm
[
'action'
],
'created_at'
=>
now
(),
'updated_at'
=>
now
(),
]);
}
// Also seed the 5050 account if missing
$academies
=
DB
::
table
(
'academies'
)
->
pluck
(
'id'
);
foreach
(
$academies
as
$academyId
)
{
DB
::
table
(
'financial_accounts'
)
->
insertOrIgnore
([
'academy_id'
=>
$academyId
,
'code'
=>
'5050'
,
'name'
=>
'Miscellaneous Expenses'
,
'name_ar'
=>
'مصروفات نثرية'
,
'type'
=>
'expense'
,
'category'
=>
'operating'
,
'is_system'
=>
true
,
'is_active'
=>
true
,
'created_at'
=>
now
(),
'updated_at'
=>
now
(),
]);
$exists
=
DB
::
table
(
'financial_accounts'
)
->
where
(
'academy_id'
,
$academyId
)
->
where
(
'code'
,
'5050'
)
->
exists
();
if
(
!
$exists
)
{
DB
::
table
(
'financial_accounts'
)
->
insert
([
'uuid'
=>
(
string
)
\Illuminate\Support\Str
::
uuid
(),
'academy_id'
=>
$academyId
,
'code'
=>
'5050'
,
'name'
=>
'Miscellaneous Expenses'
,
'name_ar'
=>
'مصروفات نثرية'
,
'type'
=>
'expense'
,
'category'
=>
'operating'
,
'is_system'
=>
true
,
'is_active'
=>
true
,
'created_at'
=>
now
(),
'updated_at'
=>
now
(),
]);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment