Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
laravel-adminpanel
Commits
eb880c0d
Commit
eb880c0d
authored
Dec 07, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/viralsolani/laravel-adminpanel
parents
9ffcda56
c81c0d6b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
45 deletions
+22
-45
.gitignore
.gitignore
+2
-1
BlogsRepository.php
app/Repositories/Backend/Blogs/BlogsRepository.php
+13
-37
mix-manifest.json
public/mix-manifest.json
+7
-7
No files found.
.gitignore
View file @
eb880c0d
...
...
@@ -26,3 +26,4 @@ public/css
public/js
composer.lock
public/img/backend/blog_images/*
app/Repositories/Backend/Blogs/BlogsRepository.php
View file @
eb880c0d
...
...
@@ -75,25 +75,15 @@ class BlogsRepository extends BaseRepository
if
(
$blogs
->
save
())
{
// Inserting associated category's id in mapper table
for
(
$i
=
0
;
$i
<
count
(
$categoriesArray
);
$i
++
)
{
$blogMapCategory
[]
=
[
'blog_id'
=>
$blogs
->
id
,
'category_id'
=>
$categoriesArray
[
$i
],
];
if
(
count
(
$categoriesArray
))
{
$blogs
->
categories
()
->
sync
(
$categoriesArray
);
}
BlogMapCategory
::
insert
(
$blogMapCategory
);
// Inserting associated tag's id in mapper table
for
(
$i
=
0
;
$i
<
count
(
$tagsArray
);
$i
++
)
{
$blogMapTags
[]
=
[
'blog_id'
=>
$blogs
->
id
,
'tag_id'
=>
$tagsArray
[
$i
],
];
if
(
count
(
$tagsArray
))
{
$blogs
->
tags
()
->
sync
(
$tagsArray
);
}
BlogMapTag
::
insert
(
$blogMapTags
);
event
(
new
BlogCreated
(
$blogs
));
return
true
;
...
...
@@ -104,14 +94,12 @@ class BlogsRepository extends BaseRepository
}
/**
* @param Model $permission
* @param $input
*
* @throws GeneralException
*
* return bool
* @param $blogs
* @param array $input
* @param array $tagsArray
* @param array $categoriesArray
*/
public
function
update
(
Model
$blogs
,
array
$input
,
array
$tagsArray
,
array
$categoriesArray
)
public
function
update
(
$blogs
,
array
$input
,
array
$tagsArray
,
array
$categoriesArray
)
{
// dd( Carbon::parse($input['publish_datetime']));
// dd($input['publish_datetime']);
...
...
@@ -137,27 +125,15 @@ class BlogsRepository extends BaseRepository
if
(
$blogs
->
save
())
{
// Updateing associated category's id in mapper table
BlogMapCategory
::
where
(
'blog_id'
,
$blogs
->
id
)
->
delete
();
for
(
$i
=
0
;
$i
<
count
(
$categoriesArray
);
$i
++
)
{
$blogMapCategory
[]
=
[
'blog_id'
=>
$blogs
->
id
,
'category_id'
=>
$categoriesArray
[
$i
],
];
if
(
count
(
$categoriesArray
))
{
$blogs
->
categories
()
->
sync
(
$categoriesArray
);
}
BlogMapCategory
::
insert
(
$blogMapCategory
);
// Updating associated tag's id in mapper table
BlogMapTag
::
where
(
'blog_id'
,
$blogs
->
id
)
->
delete
();
for
(
$i
=
0
;
$i
<
count
(
$tagsArray
);
$i
++
)
{
$blogMapTags
[]
=
[
'blog_id'
=>
$blogs
->
id
,
'tag_id'
=>
$tagsArray
[
$i
],
];
if
(
count
(
$tagsArray
))
{
$blogs
->
tags
()
->
sync
(
$tagsArray
);
}
BlogMapTag
::
insert
(
$blogMapTags
);
event
(
new
BlogUpdated
(
$blogs
));
return
true
;
...
...
public/mix-manifest.json
View file @
eb880c0d
{
"/js/frontend.js"
:
"/js/frontend.
d3a9d9963b6da237bfe
8.js"
,
"/js/backend.js"
:
"/js/backend.
51a14fd841ccd198e500
.js"
,
"/js/frontend.js"
:
"/js/frontend.
f5faf334d6b2231b48c
8.js"
,
"/js/backend.js"
:
"/js/backend.
d106d5f7e2110ee3cea7
.js"
,
"/mix.js"
:
"/mix.247ab120fe7680658924.js"
,
"/css/frontend.css"
:
"/css/frontend.
3af0a6cbd7d1d8d042f2a37e97008b7c
.css"
,
"/css/backend.css"
:
"/css/backend.
f8550f50504e5b8ef6055285205f223a
.css"
,
"/css/backend-custom.css"
:
"/css/backend-custom.
50f14193ab908e3cf471dea6cb6616ae
.css"
,
"/js/backend-custom.js"
:
"/js/backend-custom.
69e7d487a5a38a38520a62a5c53584f9
.js"
,
"/js/dataTable.js"
:
"/js/dataTable.
f968d300a6a0b871f138f114361259c8
.js"
"/css/frontend.css"
:
"/css/frontend.
90a13bfbf8d4ea6a30a8eb218e8d48b3
.css"
,
"/css/backend.css"
:
"/css/backend.
7b6d826816293ff35f4185341567f559
.css"
,
"/css/backend-custom.css"
:
"/css/backend-custom.
187b92dacd8c501e4a19407d700d279b
.css"
,
"/js/backend-custom.js"
:
"/js/backend-custom.
3ee9346acb0cd5e1f3edf70e9117e1f4
.js"
,
"/js/dataTable.js"
:
"/js/dataTable.
0db0f52a09a62d485aa1229ed981b1cf
.js"
}
\ No newline at end of file
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