Issues (256)

src/Http/Controllers/StoreController.php (2 issues)

Labels
1
<?php
2
3
namespace Ijeffro\Laralocker\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Ijeffro\Laralocker\Facades\LearningLocker;
7
8
class StoreController extends Controller
9
{
10
    /**
11
     * Display a listing of the resource.
12
     *
13
     * @return \Illuminate\Http\Response
14
     */
15
    public function index()
16
    {
17
        return LearningLocker::stores()->get();
0 ignored issues
show
The method stores() does not exist on Ijeffro\LaraLocker\Facades\LearningLocker. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
        return LearningLocker::/** @scrutinizer ignore-call */ stores()->get();
Loading history...
18
    }
19
20
    /**
21
     * Display the specified resource.
22
     *
23
     * @param  int  $id
24
     * @return \Illuminate\Http\Response
25
     */
26
    public function show($id)
27
    {
28
        $selectables = ["_id"];
29
        return LearningLocker::store($id)->get($selectables);
0 ignored issues
show
The method store() does not exist on Ijeffro\LaraLocker\Facades\LearningLocker. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        return LearningLocker::/** @scrutinizer ignore-call */ store($id)->get($selectables);
Loading history...
30
    }
31
32
    /**
33
     * Store a newly created resource in storage.
34
     *
35
     * @param  \Illuminate\Http\Request  $request
36
     * @return \Illuminate\Http\Response
37
     */
38
    public function save(Request $request)
39
    {
40
        $data = request()->all();
41
        return LearningLocker::store()->create($data);
42
    }
43
44
    /**
45
     * Update the specified resource in storage.
46
     *
47
     * @param  \Illuminate\Http\Request $request
48
     * @param  int  $id
49
     * @return \Illuminate\Http\Response
50
     */
51
    public function update(Request $request, $id)
52
    {
53
        $data = request()->all();
54
        return LearningLocker::store($id)->update($data);
55
    }
56
57
    /**
58
     * Remove the specified resource from storage.
59
     *
60
     * @param  int  $id
61
     * @return \Illuminate\Http\Response
62
     */
63
    public function destroy($id)
64
    {
65
        return LearningLocker::store($id)->delete();
66
    }
67
68
}
69