03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Deployment 90<br />

10 protected $name = "asset";<br />

11<br />

12 protected $description = "Lists asset commands.";<br />

13<br />

14 public function fire()<br />

15 {<br />

16 $this->line(trim("<br />

17 asset:combine<br />

18 combines resource files.<br />

19 "));<br />

20<br />

21 $this->line(trim("<br />

22 asset:minify<br />

23 minifies resource files.<br />

24 "));<br />

25 }<br />

26<br />

27 protected function getArguments()<br />

28 {<br />

29 return [];<br />

30 }<br />

31<br />

32 protected function getOptions()<br />

33 {<br />

34 return [];<br />

35 }<br />

36<br />

37 protected function getPath()<br />

38 {<br />

39 return public_path();<br />

40 }<br />

41<br />

42 protected function getCollection($input, $filters = [])<br />

43 {<br />

44 $path = $this->getPath();<br />

45 $input = explode(",", $input);<br />

46 $collection = new AssetCollection([], $filters);<br />

47<br />

48 foreach ($input as $asset)<br />

49 {<br />

50 $collection->add(<br />

51 new FileAsset($path . "/" . $asset)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!